diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 1324b7e..334967f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -24,14 +24,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + pip install -r requirements.txt + pip install -r test-requirements.txt - name: Test with pytest run: | - pytest + pytest --cov={{packageName}} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0858fdc..10cba65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,12 +14,18 @@ stages: - pip install -r test-requirements.txt - pytest --cov=neurostore_sdk -pytest-3.7: - extends: .pytest - image: python:3.7-alpine pytest-3.8: extends: .pytest image: python:3.8-alpine pytest-3.9: extends: .pytest - image: python:3.9-alpine \ No newline at end of file + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 43015bb..c5e7360 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -51,15 +51,27 @@ docs/ImageRelationships.md docs/ImageRequest.md docs/ImageReturn.md docs/ImagesApi.md -docs/JsonLd.md docs/JsonLdContext.md -docs/Metadata.md docs/NestedPutAttributes.md docs/NoteCollectionBase.md docs/NoteCollectionList.md docs/NoteCollectionRequest.md docs/NoteCollectionReturn.md -docs/NoteCollectionReturnAllOf.md +docs/Pipeline.md +docs/PipelineConfig.md +docs/PipelineConfigList.md +docs/PipelineConfigsApi.md +docs/PipelineList.md +docs/PipelineRun.md +docs/PipelineRunList.md +docs/PipelineRunResult.md +docs/PipelineRunResultList.md +docs/PipelineRunResultVote.md +docs/PipelineRunResultVoteList.md +docs/PipelineRunResultVotesApi.md +docs/PipelineRunResultsApi.md +docs/PipelineRunsApi.md +docs/PipelinesApi.md docs/PointBase.md docs/PointCommon.md docs/PointList.md @@ -69,7 +81,6 @@ docs/PointRequest.md docs/PointReturn.md docs/PointValue.md docs/PointsApi.md -docs/ReadableResourceAttributes.md docs/ResourceAttributes.md docs/StoreApi.md docs/StudiesApi.md @@ -77,13 +88,11 @@ docs/StudyBase.md docs/StudyCommon.md docs/StudyList.md docs/StudyRequest.md -docs/StudyRequestAllOf.md docs/StudyRequestRelationships.md docs/StudyRequestRelationshipsAnalyses.md docs/StudyReturn.md -docs/StudyReturnAllOf.md -docs/StudyReturnAllOfStudysetsInner.md -docs/StudyReturnAllOfStudysetsInnerOneOf.md +docs/StudyReturnAllOfStudysets.md +docs/StudyReturnAllOfStudysetsOneOf.md docs/StudyReturnRelationships.md docs/StudyReturnRelationshipsAnalyses.md docs/StudysetBase.md @@ -99,9 +108,7 @@ docs/StudysetsIdPut422Response.md docs/User.md docs/UserApi.md docs/UserList.md -docs/UserResourceAttributes.md docs/UserlessResourceAttributes.md -docs/WriteableResourceAttributes.md git_push.sh neurostore_sdk/__init__.py neurostore_sdk/api/__init__.py @@ -109,6 +116,11 @@ neurostore_sdk/api/analyses_api.py neurostore_sdk/api/annotations_api.py neurostore_sdk/api/conditions_api.py neurostore_sdk/api/images_api.py +neurostore_sdk/api/pipeline_configs_api.py +neurostore_sdk/api/pipeline_run_result_votes_api.py +neurostore_sdk/api/pipeline_run_results_api.py +neurostore_sdk/api/pipeline_runs_api.py +neurostore_sdk/api/pipelines_api.py neurostore_sdk/api/points_api.py neurostore_sdk/api/store_api.py neurostore_sdk/api/studies_api.py @@ -163,15 +175,22 @@ neurostore_sdk/models/image_list.py neurostore_sdk/models/image_relationships.py neurostore_sdk/models/image_request.py neurostore_sdk/models/image_return.py -neurostore_sdk/models/json_ld.py neurostore_sdk/models/json_ld_context.py -neurostore_sdk/models/metadata.py neurostore_sdk/models/nested_put_attributes.py neurostore_sdk/models/note_collection_base.py neurostore_sdk/models/note_collection_list.py neurostore_sdk/models/note_collection_request.py neurostore_sdk/models/note_collection_return.py -neurostore_sdk/models/note_collection_return_all_of.py +neurostore_sdk/models/pipeline.py +neurostore_sdk/models/pipeline_config.py +neurostore_sdk/models/pipeline_config_list.py +neurostore_sdk/models/pipeline_list.py +neurostore_sdk/models/pipeline_run.py +neurostore_sdk/models/pipeline_run_list.py +neurostore_sdk/models/pipeline_run_result.py +neurostore_sdk/models/pipeline_run_result_list.py +neurostore_sdk/models/pipeline_run_result_vote.py +neurostore_sdk/models/pipeline_run_result_vote_list.py neurostore_sdk/models/point_base.py neurostore_sdk/models/point_common.py neurostore_sdk/models/point_list.py @@ -180,19 +199,16 @@ neurostore_sdk/models/point_relationships_values.py neurostore_sdk/models/point_request.py neurostore_sdk/models/point_return.py neurostore_sdk/models/point_value.py -neurostore_sdk/models/readable_resource_attributes.py neurostore_sdk/models/resource_attributes.py 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 -neurostore_sdk/models/study_return_all_of.py -neurostore_sdk/models/study_return_all_of_studysets_inner.py -neurostore_sdk/models/study_return_all_of_studysets_inner_one_of.py +neurostore_sdk/models/study_return_all_of_studysets.py +neurostore_sdk/models/study_return_all_of_studysets_one_of.py neurostore_sdk/models/study_return_relationships.py neurostore_sdk/models/study_return_relationships_analyses.py neurostore_sdk/models/studyset_base.py @@ -206,9 +222,8 @@ neurostore_sdk/models/studysets_id_get404_response.py neurostore_sdk/models/studysets_id_put422_response.py neurostore_sdk/models/user.py neurostore_sdk/models/user_list.py -neurostore_sdk/models/user_resource_attributes.py neurostore_sdk/models/userless_resource_attributes.py -neurostore_sdk/models/writeable_resource_attributes.py +neurostore_sdk/py.typed neurostore_sdk/rest.py pyproject.toml requirements.txt diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index cd802a1..b23eb27 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.6.0 \ No newline at end of file +7.11.0 diff --git a/.travis.yml b/.travis.yml index 348fcde..15f5133 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" + - "3.12" # uncomment the following if needed - #- "3.11-dev" # 3.11 development branch + #- "3.12-dev" # 3.12 development branch #- "nightly" # nightly build # command to install dependencies install: diff --git a/README.md b/README.md index 89fd4f9..5f3ac55 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,13 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0 - Package version: 0.0.1 -- Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen +- Generator version: 7.11.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://github.com/jdkent](https://github.com/jdkent) ## Requirements. -Python 3.7+ +Python 3.8+ ## Installation & Usage ### pip install @@ -51,7 +52,6 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python -import time import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -121,6 +121,31 @@ Class | Method | HTTP request | Description *ImagesApi* | [**images_id_get**](docs/ImagesApi.md#images_id_get) | **GET** /images/{id} | GET an image *ImagesApi* | [**images_id_put**](docs/ImagesApi.md#images_id_put) | **PUT** /images/{id} | PUT/update an image *ImagesApi* | [**images_post**](docs/ImagesApi.md#images_post) | **POST** /images/ | POST/create an image +*PipelineConfigsApi* | [**pipeline_configs_get**](docs/PipelineConfigsApi.md#pipeline_configs_get) | **GET** /pipeline-configs/ | GET a list of pipeline configs +*PipelineConfigsApi* | [**pipeline_configs_id_delete**](docs/PipelineConfigsApi.md#pipeline_configs_id_delete) | **DELETE** /pipeline-configs/{id} | DELETE a pipeline config by ID +*PipelineConfigsApi* | [**pipeline_configs_id_get**](docs/PipelineConfigsApi.md#pipeline_configs_id_get) | **GET** /pipeline-configs/{id} | GET a pipeline config by ID +*PipelineConfigsApi* | [**pipeline_configs_id_put**](docs/PipelineConfigsApi.md#pipeline_configs_id_put) | **PUT** /pipeline-configs/{id} | PUT/update a pipeline config by ID +*PipelineConfigsApi* | [**pipeline_configs_post**](docs/PipelineConfigsApi.md#pipeline_configs_post) | **POST** /pipeline-configs/ | POST/create a pipeline config +*PipelineRunResultVotesApi* | [**pipeline_run_result_votes_get**](docs/PipelineRunResultVotesApi.md#pipeline_run_result_votes_get) | **GET** /pipeline-run-result-votes/ | GET a list of pipeline run result votes +*PipelineRunResultVotesApi* | [**pipeline_run_result_votes_pipeline_run_result_vote_id_delete**](docs/PipelineRunResultVotesApi.md#pipeline_run_result_votes_pipeline_run_result_vote_id_delete) | **DELETE** /pipeline-run-result-votes/{pipeline_run_result_vote_id} | DELETE a pipeline run result vote by ID +*PipelineRunResultVotesApi* | [**pipeline_run_result_votes_pipeline_run_result_vote_id_get**](docs/PipelineRunResultVotesApi.md#pipeline_run_result_votes_pipeline_run_result_vote_id_get) | **GET** /pipeline-run-result-votes/{pipeline_run_result_vote_id} | GET a pipeline run result vote by ID +*PipelineRunResultVotesApi* | [**pipeline_run_result_votes_pipeline_run_result_vote_id_put**](docs/PipelineRunResultVotesApi.md#pipeline_run_result_votes_pipeline_run_result_vote_id_put) | **PUT** /pipeline-run-result-votes/{pipeline_run_result_vote_id} | PUT/update a pipeline run result vote by ID +*PipelineRunResultVotesApi* | [**pipeline_run_result_votes_post**](docs/PipelineRunResultVotesApi.md#pipeline_run_result_votes_post) | **POST** /pipeline-run-result-votes/ | POST/create a pipeline run result vote +*PipelineRunResultsApi* | [**pipeline_run_results_get**](docs/PipelineRunResultsApi.md#pipeline_run_results_get) | **GET** /pipeline-run-results/ | GET a list of pipeline run results +*PipelineRunResultsApi* | [**pipeline_run_results_pipeline_run_result_id_delete**](docs/PipelineRunResultsApi.md#pipeline_run_results_pipeline_run_result_id_delete) | **DELETE** /pipeline-run-results/{pipeline_run_result_id} | DELETE a pipeline run result by ID +*PipelineRunResultsApi* | [**pipeline_run_results_pipeline_run_result_id_get**](docs/PipelineRunResultsApi.md#pipeline_run_results_pipeline_run_result_id_get) | **GET** /pipeline-run-results/{pipeline_run_result_id} | GET a pipeline run result by ID +*PipelineRunResultsApi* | [**pipeline_run_results_pipeline_run_result_id_put**](docs/PipelineRunResultsApi.md#pipeline_run_results_pipeline_run_result_id_put) | **PUT** /pipeline-run-results/{pipeline_run_result_id} | PUT/update a pipeline run result by ID +*PipelineRunResultsApi* | [**pipeline_run_results_post**](docs/PipelineRunResultsApi.md#pipeline_run_results_post) | **POST** /pipeline-run-results/ | POST/create a pipeline run result +*PipelineRunsApi* | [**pipeline_runs_get**](docs/PipelineRunsApi.md#pipeline_runs_get) | **GET** /pipeline-runs/ | GET a list of pipeline runs +*PipelineRunsApi* | [**pipeline_runs_pipeline_run_id_delete**](docs/PipelineRunsApi.md#pipeline_runs_pipeline_run_id_delete) | **DELETE** /pipeline-runs/{pipeline_run_id} | DELETE a pipeline run by ID +*PipelineRunsApi* | [**pipeline_runs_pipeline_run_id_get**](docs/PipelineRunsApi.md#pipeline_runs_pipeline_run_id_get) | **GET** /pipeline-runs/{pipeline_run_id} | GET a pipeline run by ID +*PipelineRunsApi* | [**pipeline_runs_pipeline_run_id_put**](docs/PipelineRunsApi.md#pipeline_runs_pipeline_run_id_put) | **PUT** /pipeline-runs/{pipeline_run_id} | PUT/update a pipeline run by ID +*PipelineRunsApi* | [**pipeline_runs_post**](docs/PipelineRunsApi.md#pipeline_runs_post) | **POST** /pipeline-runs/ | POST/create a pipeline run +*PipelinesApi* | [**pipelines_get**](docs/PipelinesApi.md#pipelines_get) | **GET** /pipelines/ | GET a list of pipelines +*PipelinesApi* | [**pipelines_id_delete**](docs/PipelinesApi.md#pipelines_id_delete) | **DELETE** /pipelines/{id} | DELETE a pipeline by ID +*PipelinesApi* | [**pipelines_id_get**](docs/PipelinesApi.md#pipelines_id_get) | **GET** /pipelines/{id} | GET a pipeline by ID +*PipelinesApi* | [**pipelines_id_put**](docs/PipelinesApi.md#pipelines_id_put) | **PUT** /pipelines/{id} | PUT/update a pipeline by ID +*PipelinesApi* | [**pipelines_post**](docs/PipelinesApi.md#pipelines_post) | **POST** /pipelines/ | POST/create a pipeline *PointsApi* | [**points_get**](docs/PointsApi.md#points_get) | **GET** /points/ | Get Points *PointsApi* | [**points_id_delete**](docs/PointsApi.md#points_id_delete) | **DELETE** /points/{id} | DELETE a point *PointsApi* | [**points_id_get**](docs/PointsApi.md#points_id_get) | **GET** /points/{id} | GET a point @@ -234,15 +259,22 @@ Class | Method | HTTP request | Description - [ImageRelationships](docs/ImageRelationships.md) - [ImageRequest](docs/ImageRequest.md) - [ImageReturn](docs/ImageReturn.md) - - [JsonLd](docs/JsonLd.md) - [JsonLdContext](docs/JsonLdContext.md) - - [Metadata](docs/Metadata.md) - [NestedPutAttributes](docs/NestedPutAttributes.md) - [NoteCollectionBase](docs/NoteCollectionBase.md) - [NoteCollectionList](docs/NoteCollectionList.md) - [NoteCollectionRequest](docs/NoteCollectionRequest.md) - [NoteCollectionReturn](docs/NoteCollectionReturn.md) - - [NoteCollectionReturnAllOf](docs/NoteCollectionReturnAllOf.md) + - [Pipeline](docs/Pipeline.md) + - [PipelineConfig](docs/PipelineConfig.md) + - [PipelineConfigList](docs/PipelineConfigList.md) + - [PipelineList](docs/PipelineList.md) + - [PipelineRun](docs/PipelineRun.md) + - [PipelineRunList](docs/PipelineRunList.md) + - [PipelineRunResult](docs/PipelineRunResult.md) + - [PipelineRunResultList](docs/PipelineRunResultList.md) + - [PipelineRunResultVote](docs/PipelineRunResultVote.md) + - [PipelineRunResultVoteList](docs/PipelineRunResultVoteList.md) - [PointBase](docs/PointBase.md) - [PointCommon](docs/PointCommon.md) - [PointList](docs/PointList.md) @@ -251,19 +283,16 @@ Class | Method | HTTP request | Description - [PointRequest](docs/PointRequest.md) - [PointReturn](docs/PointReturn.md) - [PointValue](docs/PointValue.md) - - [ReadableResourceAttributes](docs/ReadableResourceAttributes.md) - [ResourceAttributes](docs/ResourceAttributes.md) - [StudyBase](docs/StudyBase.md) - [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) - - [StudyReturnAllOf](docs/StudyReturnAllOf.md) - - [StudyReturnAllOfStudysetsInner](docs/StudyReturnAllOfStudysetsInner.md) - - [StudyReturnAllOfStudysetsInnerOneOf](docs/StudyReturnAllOfStudysetsInnerOneOf.md) + - [StudyReturnAllOfStudysets](docs/StudyReturnAllOfStudysets.md) + - [StudyReturnAllOfStudysetsOneOf](docs/StudyReturnAllOfStudysetsOneOf.md) - [StudyReturnRelationships](docs/StudyReturnRelationships.md) - [StudyReturnRelationshipsAnalyses](docs/StudyReturnRelationshipsAnalyses.md) - [StudysetBase](docs/StudysetBase.md) @@ -277,9 +306,7 @@ Class | Method | HTTP request | Description - [StudysetsIdPut422Response](docs/StudysetsIdPut422Response.md) - [User](docs/User.md) - [UserList](docs/UserList.md) - - [UserResourceAttributes](docs/UserResourceAttributes.md) - [UserlessResourceAttributes](docs/UserlessResourceAttributes.md) - - [WriteableResourceAttributes](docs/WriteableResourceAttributes.md) diff --git a/docs/AnalysesApi.md b/docs/AnalysesApi.md index 3e426c9..64e5c74 100644 --- a/docs/AnalysesApi.md +++ b/docs/AnalysesApi.md @@ -24,9 +24,8 @@ List all analyses performed across studies. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_list import AnalysisList from neurostore_sdk.rest import ApiException @@ -62,8 +61,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -89,6 +90,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -105,9 +107,8 @@ delete an analysis ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -142,8 +143,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -162,6 +165,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -177,9 +181,8 @@ Information pertaining to a particular analysis within a study. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_return import AnalysisReturn from neurostore_sdk.rest import ApiException @@ -209,8 +212,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -230,6 +235,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -247,9 +253,8 @@ Update an existing analysis. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_request import AnalysisRequest from neurostore_sdk.models.analysis_return import AnalysisReturn @@ -289,8 +294,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -310,6 +317,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -327,9 +335,8 @@ create an analysis ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_request import AnalysisRequest from neurostore_sdk.models.analysis_return import AnalysisReturn @@ -368,8 +375,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_request** | [**AnalysisRequest**](AnalysisRequest.md)| | [optional] @@ -388,6 +397,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -401,9 +411,8 @@ Get annotation analyses ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_list import NoteCollectionList from neurostore_sdk.rest import ApiException @@ -431,7 +440,9 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -448,6 +459,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -463,9 +475,8 @@ Your GET endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_return import NoteCollectionReturn from neurostore_sdk.rest import ApiException @@ -503,8 +514,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -523,6 +536,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -537,9 +551,8 @@ Your PUT endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn @@ -579,8 +592,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -600,6 +615,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -616,9 +632,8 @@ This endpoint does not allow for creation, only modification of existing annotat ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn @@ -657,8 +672,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **note_collection_request** | [**List[NoteCollectionRequest]**](NoteCollectionRequest.md)| | [optional] @@ -677,6 +694,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/AnalysisBase.md b/docs/AnalysisBase.md index d8ef8a6..6aaff70 100644 --- a/docs/AnalysisBase.md +++ b/docs/AnalysisBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | A name of the contrast being performed. | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of AnalysisBase from a JSON string analysis_base_instance = AnalysisBase.from_json(json) # print the JSON string representation of the object -print AnalysisBase.to_json() +print(AnalysisBase.to_json()) # convert the object into a dict analysis_base_dict = analysis_base_instance.to_dict() # create an instance of AnalysisBase from a dict -analysis_base_form_dict = analysis_base.from_dict(analysis_base_dict) +analysis_base_from_dict = AnalysisBase.from_dict(analysis_base_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) diff --git a/docs/AnalysisCommon.md b/docs/AnalysisCommon.md index 0752705..c7d7eea 100644 --- a/docs/AnalysisCommon.md +++ b/docs/AnalysisCommon.md @@ -3,11 +3,13 @@ attributes common between request and return objects ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **study** | **str** | | [optional] **entities** | [**List[Entity]**](Entity.md) | | [optional] **order** | **int** | | [optional] +**metadata** | **object** | | [optional] ## Example @@ -19,12 +21,12 @@ json = "{}" # create an instance of AnalysisCommon from a JSON string analysis_common_instance = AnalysisCommon.from_json(json) # print the JSON string representation of the object -print AnalysisCommon.to_json() +print(AnalysisCommon.to_json()) # convert the object into a dict analysis_common_dict = analysis_common_instance.to_dict() # create an instance of AnalysisCommon from a dict -analysis_common_form_dict = analysis_common.from_dict(analysis_common_dict) +analysis_common_from_dict = AnalysisCommon.from_dict(analysis_common_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) diff --git a/docs/AnalysisList.md b/docs/AnalysisList.md index 88dd43c..44cdf65 100644 --- a/docs/AnalysisList.md +++ b/docs/AnalysisList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | [**Metadata**](Metadata.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of AnalysisList from a JSON string analysis_list_instance = AnalysisList.from_json(json) # print the JSON string representation of the object -print AnalysisList.to_json() +print(AnalysisList.to_json()) # convert the object into a dict analysis_list_dict = analysis_list_instance.to_dict() # create an instance of AnalysisList from a dict -analysis_list_form_dict = analysis_list.from_dict(analysis_list_dict) +analysis_list_from_dict = AnalysisList.from_dict(analysis_list_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) diff --git a/docs/AnalysisRequest.md b/docs/AnalysisRequest.md index 13d8f34..a7484f3 100644 --- a/docs/AnalysisRequest.md +++ b/docs/AnalysisRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | A name of the contrast being performed. | [optional] @@ -15,6 +16,7 @@ Name | Type | Description | Notes **public** | **bool** | whether the resource is listed in public searches or not | [optional] [default to True] **entities** | [**List[Entity]**](Entity.md) | | [optional] **order** | **int** | | [optional] +**metadata** | **object** | | [optional] ## Example @@ -26,12 +28,12 @@ json = "{}" # create an instance of AnalysisRequest from a JSON string analysis_request_instance = AnalysisRequest.from_json(json) # print the JSON string representation of the object -print AnalysisRequest.to_json() +print(AnalysisRequest.to_json()) # convert the object into a dict analysis_request_dict = analysis_request_instance.to_dict() # create an instance of AnalysisRequest from a dict -analysis_request_form_dict = analysis_request.from_dict(analysis_request_dict) +analysis_request_from_dict = AnalysisRequest.from_dict(analysis_request_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) diff --git a/docs/AnalysisRequestRelationships.md b/docs/AnalysisRequestRelationships.md index 482d73c..789ce65 100644 --- a/docs/AnalysisRequestRelationships.md +++ b/docs/AnalysisRequestRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **study** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of AnalysisRequestRelationships from a JSON string analysis_request_relationships_instance = AnalysisRequestRelationships.from_json(json) # print the JSON string representation of the object -print AnalysisRequestRelationships.to_json() +print(AnalysisRequestRelationships.to_json()) # convert the object into a dict analysis_request_relationships_dict = analysis_request_relationships_instance.to_dict() # create an instance of AnalysisRequestRelationships from a dict -analysis_request_relationships_form_dict = analysis_request_relationships.from_dict(analysis_request_relationships_dict) +analysis_request_relationships_from_dict = AnalysisRequestRelationships.from_dict(analysis_request_relationships_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) diff --git a/docs/AnalysisRequestRelationshipsConditions.md b/docs/AnalysisRequestRelationshipsConditions.md index ba8ed2a..3b40a52 100644 --- a/docs/AnalysisRequestRelationshipsConditions.md +++ b/docs/AnalysisRequestRelationshipsConditions.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnalysisRequestRelationshipsConditions from a JSON string analysis_request_relationships_conditions_instance = AnalysisRequestRelationshipsConditions.from_json(json) # print the JSON string representation of the object -print AnalysisRequestRelationshipsConditions.to_json() +print(AnalysisRequestRelationshipsConditions.to_json()) # convert the object into a dict analysis_request_relationships_conditions_dict = analysis_request_relationships_conditions_instance.to_dict() # create an instance of AnalysisRequestRelationshipsConditions from a dict -analysis_request_relationships_conditions_form_dict = analysis_request_relationships_conditions.from_dict(analysis_request_relationships_conditions_dict) +analysis_request_relationships_conditions_from_dict = AnalysisRequestRelationshipsConditions.from_dict(analysis_request_relationships_conditions_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) diff --git a/docs/AnalysisRequestRelationshipsConditionsInner.md b/docs/AnalysisRequestRelationshipsConditionsInner.md deleted file mode 100644 index a5faa73..0000000 --- a/docs/AnalysisRequestRelationshipsConditionsInner.md +++ /dev/null @@ -1,31 +0,0 @@ -# AnalysisRequestRelationshipsConditionsInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | Name of the condition being applied in the contrast, either psychological, pharmacological, or group based. | [optional] -**description** | **str** | Long form description of how the condition is operationalized and/or specific meaning. | [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] - -## Example - -```python -from neurostore_sdk.models.analysis_request_relationships_conditions_inner import AnalysisRequestRelationshipsConditionsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnalysisRequestRelationshipsConditionsInner from a JSON string -analysis_request_relationships_conditions_inner_instance = AnalysisRequestRelationshipsConditionsInner.from_json(json) -# print the JSON string representation of the object -print AnalysisRequestRelationshipsConditionsInner.to_json() - -# convert the object into a dict -analysis_request_relationships_conditions_inner_dict = analysis_request_relationships_conditions_inner_instance.to_dict() -# create an instance of AnalysisRequestRelationshipsConditionsInner from a dict -analysis_request_relationships_conditions_inner_form_dict = analysis_request_relationships_conditions_inner.from_dict(analysis_request_relationships_conditions_inner_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) - - diff --git a/docs/AnalysisRequestRelationshipsImages.md b/docs/AnalysisRequestRelationshipsImages.md index 8ad4d8c..de6f1b1 100644 --- a/docs/AnalysisRequestRelationshipsImages.md +++ b/docs/AnalysisRequestRelationshipsImages.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnalysisRequestRelationshipsImages from a JSON string analysis_request_relationships_images_instance = AnalysisRequestRelationshipsImages.from_json(json) # print the JSON string representation of the object -print AnalysisRequestRelationshipsImages.to_json() +print(AnalysisRequestRelationshipsImages.to_json()) # convert the object into a dict analysis_request_relationships_images_dict = analysis_request_relationships_images_instance.to_dict() # create an instance of AnalysisRequestRelationshipsImages from a dict -analysis_request_relationships_images_form_dict = analysis_request_relationships_images.from_dict(analysis_request_relationships_images_dict) +analysis_request_relationships_images_from_dict = AnalysisRequestRelationshipsImages.from_dict(analysis_request_relationships_images_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) diff --git a/docs/AnalysisRequestRelationshipsImagesInner.md b/docs/AnalysisRequestRelationshipsImagesInner.md deleted file mode 100644 index 3fb723a..0000000 --- a/docs/AnalysisRequestRelationshipsImagesInner.md +++ /dev/null @@ -1,38 +0,0 @@ -# AnalysisRequestRelationshipsImagesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | **object** | Metadata about image such as software and version used and other relevant data about how the image was produced. | [optional] -**url** | **str** | URL to image file. | [optional] -**filename** | **str** | Name of the image file. | [optional] -**space** | **str** | The template space the image is in (e.g., MNI | [optional] -**value_type** | **str** | The values the image represents. For example, T-statistic or Z-statistic, or Betas. | [optional] -**add_date** | **datetime** | Date the image was added. | [optional] [readonly] -**analysis** | **str** | | [optional] -**entities** | [**List[Entity]**](Entity.md) | | [optional] -**analysis_name** | **str** | | [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] - -## Example - -```python -from neurostore_sdk.models.analysis_request_relationships_images_inner import AnalysisRequestRelationshipsImagesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnalysisRequestRelationshipsImagesInner from a JSON string -analysis_request_relationships_images_inner_instance = AnalysisRequestRelationshipsImagesInner.from_json(json) -# print the JSON string representation of the object -print AnalysisRequestRelationshipsImagesInner.to_json() - -# convert the object into a dict -analysis_request_relationships_images_inner_dict = analysis_request_relationships_images_inner_instance.to_dict() -# create an instance of AnalysisRequestRelationshipsImagesInner from a dict -analysis_request_relationships_images_inner_form_dict = analysis_request_relationships_images_inner.from_dict(analysis_request_relationships_images_inner_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) - - diff --git a/docs/AnalysisRequestRelationshipsPoints.md b/docs/AnalysisRequestRelationshipsPoints.md index 70c9f16..d164e73 100644 --- a/docs/AnalysisRequestRelationshipsPoints.md +++ b/docs/AnalysisRequestRelationshipsPoints.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnalysisRequestRelationshipsPoints from a JSON string analysis_request_relationships_points_instance = AnalysisRequestRelationshipsPoints.from_json(json) # print the JSON string representation of the object -print AnalysisRequestRelationshipsPoints.to_json() +print(AnalysisRequestRelationshipsPoints.to_json()) # convert the object into a dict analysis_request_relationships_points_dict = analysis_request_relationships_points_instance.to_dict() # create an instance of AnalysisRequestRelationshipsPoints from a dict -analysis_request_relationships_points_form_dict = analysis_request_relationships_points.from_dict(analysis_request_relationships_points_dict) +analysis_request_relationships_points_from_dict = AnalysisRequestRelationshipsPoints.from_dict(analysis_request_relationships_points_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) diff --git a/docs/AnalysisRequestRelationshipsPointsInner.md b/docs/AnalysisRequestRelationshipsPointsInner.md deleted file mode 100644 index 6582901..0000000 --- a/docs/AnalysisRequestRelationshipsPointsInner.md +++ /dev/null @@ -1,40 +0,0 @@ -# AnalysisRequestRelationshipsPointsInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**coordinates** | **List[float]** | Location of the significant coordinate in three dimensional space. | [optional] -**space** | **str** | Template space used to determine coordinate Examples include TAL or MNI. | [optional] -**kind** | **str** | Method of how point was derived (e.g., center of mass) | [optional] -**label_id** | **str** | If the point is associated with an image, this is the value the point takes in that image. | [optional] -**image** | **str** | | [optional] -**value** | [**PointRelationshipsValue**](PointRelationshipsValue.md) | | [optional] -**x** | **float** | | [optional] -**y** | **float** | | [optional] -**z** | **float** | | [optional] -**entities** | [**List[Entity]**](Entity.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] -**analysis** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.analysis_request_relationships_points_inner import AnalysisRequestRelationshipsPointsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnalysisRequestRelationshipsPointsInner from a JSON string -analysis_request_relationships_points_inner_instance = AnalysisRequestRelationshipsPointsInner.from_json(json) -# print the JSON string representation of the object -print AnalysisRequestRelationshipsPointsInner.to_json() - -# convert the object into a dict -analysis_request_relationships_points_inner_dict = analysis_request_relationships_points_inner_instance.to_dict() -# create an instance of AnalysisRequestRelationshipsPointsInner from a dict -analysis_request_relationships_points_inner_form_dict = analysis_request_relationships_points_inner.from_dict(analysis_request_relationships_points_inner_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) - - diff --git a/docs/AnalysisReturn.md b/docs/AnalysisReturn.md index d81661d..0cddcf0 100644 --- a/docs/AnalysisReturn.md +++ b/docs/AnalysisReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | A name of the contrast being performed. | [optional] @@ -19,6 +20,7 @@ Name | Type | Description | Notes **conditions** | [**AnalysisReturnRelationshipsConditions**](AnalysisReturnRelationshipsConditions.md) | | [optional] **entities** | [**List[Entity]**](Entity.md) | | [optional] **order** | **int** | | [optional] +**metadata** | **object** | | [optional] ## Example @@ -30,12 +32,12 @@ json = "{}" # create an instance of AnalysisReturn from a JSON string analysis_return_instance = AnalysisReturn.from_json(json) # print the JSON string representation of the object -print AnalysisReturn.to_json() +print(AnalysisReturn.to_json()) # convert the object into a dict analysis_return_dict = analysis_return_instance.to_dict() # create an instance of AnalysisReturn from a dict -analysis_return_form_dict = analysis_return.from_dict(analysis_return_dict) +analysis_return_from_dict = AnalysisReturn.from_dict(analysis_return_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) diff --git a/docs/AnalysisReturnRelationships.md b/docs/AnalysisReturnRelationships.md index 23a47ea..ba98213 100644 --- a/docs/AnalysisReturnRelationships.md +++ b/docs/AnalysisReturnRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **study** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of AnalysisReturnRelationships from a JSON string analysis_return_relationships_instance = AnalysisReturnRelationships.from_json(json) # print the JSON string representation of the object -print AnalysisReturnRelationships.to_json() +print(AnalysisReturnRelationships.to_json()) # convert the object into a dict analysis_return_relationships_dict = analysis_return_relationships_instance.to_dict() # create an instance of AnalysisReturnRelationships from a dict -analysis_return_relationships_form_dict = analysis_return_relationships.from_dict(analysis_return_relationships_dict) +analysis_return_relationships_from_dict = AnalysisReturnRelationships.from_dict(analysis_return_relationships_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) diff --git a/docs/AnalysisReturnRelationshipsConditions.md b/docs/AnalysisReturnRelationshipsConditions.md index afa534c..baed063 100644 --- a/docs/AnalysisReturnRelationshipsConditions.md +++ b/docs/AnalysisReturnRelationshipsConditions.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnalysisReturnRelationshipsConditions from a JSON string analysis_return_relationships_conditions_instance = AnalysisReturnRelationshipsConditions.from_json(json) # print the JSON string representation of the object -print AnalysisReturnRelationshipsConditions.to_json() +print(AnalysisReturnRelationshipsConditions.to_json()) # convert the object into a dict analysis_return_relationships_conditions_dict = analysis_return_relationships_conditions_instance.to_dict() # create an instance of AnalysisReturnRelationshipsConditions from a dict -analysis_return_relationships_conditions_form_dict = analysis_return_relationships_conditions.from_dict(analysis_return_relationships_conditions_dict) +analysis_return_relationships_conditions_from_dict = AnalysisReturnRelationshipsConditions.from_dict(analysis_return_relationships_conditions_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) diff --git a/docs/AnalysisReturnRelationshipsConditionsInner.md b/docs/AnalysisReturnRelationshipsConditionsInner.md deleted file mode 100644 index d8e4d96..0000000 --- a/docs/AnalysisReturnRelationshipsConditionsInner.md +++ /dev/null @@ -1,34 +0,0 @@ -# AnalysisReturnRelationshipsConditionsInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | Name of the condition being applied in the contrast, either psychological, pharmacological, or group based. | [optional] -**description** | **str** | Long form description of how the condition is operationalized and/or specific meaning. | [optional] -**created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] -**updated_at** | **str** | when was the resource last modified/updated. | [optional] [readonly] -**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] -**user** | **str** | who owns the resource | [optional] [readonly] - -## Example - -```python -from neurostore_sdk.models.analysis_return_relationships_conditions_inner import AnalysisReturnRelationshipsConditionsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnalysisReturnRelationshipsConditionsInner from a JSON string -analysis_return_relationships_conditions_inner_instance = AnalysisReturnRelationshipsConditionsInner.from_json(json) -# print the JSON string representation of the object -print AnalysisReturnRelationshipsConditionsInner.to_json() - -# convert the object into a dict -analysis_return_relationships_conditions_inner_dict = analysis_return_relationships_conditions_inner_instance.to_dict() -# create an instance of AnalysisReturnRelationshipsConditionsInner from a dict -analysis_return_relationships_conditions_inner_form_dict = analysis_return_relationships_conditions_inner.from_dict(analysis_return_relationships_conditions_inner_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) - - diff --git a/docs/AnalysisReturnRelationshipsImages.md b/docs/AnalysisReturnRelationshipsImages.md index 7c344f8..9819b16 100644 --- a/docs/AnalysisReturnRelationshipsImages.md +++ b/docs/AnalysisReturnRelationshipsImages.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnalysisReturnRelationshipsImages from a JSON string analysis_return_relationships_images_instance = AnalysisReturnRelationshipsImages.from_json(json) # print the JSON string representation of the object -print AnalysisReturnRelationshipsImages.to_json() +print(AnalysisReturnRelationshipsImages.to_json()) # convert the object into a dict analysis_return_relationships_images_dict = analysis_return_relationships_images_instance.to_dict() # create an instance of AnalysisReturnRelationshipsImages from a dict -analysis_return_relationships_images_form_dict = analysis_return_relationships_images.from_dict(analysis_return_relationships_images_dict) +analysis_return_relationships_images_from_dict = AnalysisReturnRelationshipsImages.from_dict(analysis_return_relationships_images_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) diff --git a/docs/AnalysisReturnRelationshipsImagesInner.md b/docs/AnalysisReturnRelationshipsImagesInner.md deleted file mode 100644 index fcd9071..0000000 --- a/docs/AnalysisReturnRelationshipsImagesInner.md +++ /dev/null @@ -1,41 +0,0 @@ -# AnalysisReturnRelationshipsImagesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | **object** | Metadata about image such as software and version used and other relevant data about how the image was produced. | [optional] -**url** | **str** | URL to image file. | [optional] -**filename** | **str** | Name of the image file. | [optional] -**space** | **str** | The template space the image is in (e.g., MNI | [optional] -**value_type** | **str** | The values the image represents. For example, T-statistic or Z-statistic, or Betas. | [optional] -**add_date** | **datetime** | Date the image was added. | [optional] [readonly] -**analysis** | **str** | | [optional] -**entities** | [**List[Entity]**](Entity.md) | | [optional] -**analysis_name** | **str** | | [optional] -**created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] -**updated_at** | **str** | when was the resource last modified/updated. | [optional] [readonly] -**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] -**user** | **str** | who owns the resource | [optional] [readonly] - -## Example - -```python -from neurostore_sdk.models.analysis_return_relationships_images_inner import AnalysisReturnRelationshipsImagesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnalysisReturnRelationshipsImagesInner from a JSON string -analysis_return_relationships_images_inner_instance = AnalysisReturnRelationshipsImagesInner.from_json(json) -# print the JSON string representation of the object -print AnalysisReturnRelationshipsImagesInner.to_json() - -# convert the object into a dict -analysis_return_relationships_images_inner_dict = analysis_return_relationships_images_inner_instance.to_dict() -# create an instance of AnalysisReturnRelationshipsImagesInner from a dict -analysis_return_relationships_images_inner_form_dict = analysis_return_relationships_images_inner.from_dict(analysis_return_relationships_images_inner_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) - - diff --git a/docs/AnalysisReturnRelationshipsPoints.md b/docs/AnalysisReturnRelationshipsPoints.md index b770541..96e87e5 100644 --- a/docs/AnalysisReturnRelationshipsPoints.md +++ b/docs/AnalysisReturnRelationshipsPoints.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnalysisReturnRelationshipsPoints from a JSON string analysis_return_relationships_points_instance = AnalysisReturnRelationshipsPoints.from_json(json) # print the JSON string representation of the object -print AnalysisReturnRelationshipsPoints.to_json() +print(AnalysisReturnRelationshipsPoints.to_json()) # convert the object into a dict analysis_return_relationships_points_dict = analysis_return_relationships_points_instance.to_dict() # create an instance of AnalysisReturnRelationshipsPoints from a dict -analysis_return_relationships_points_form_dict = analysis_return_relationships_points.from_dict(analysis_return_relationships_points_dict) +analysis_return_relationships_points_from_dict = AnalysisReturnRelationshipsPoints.from_dict(analysis_return_relationships_points_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) diff --git a/docs/AnalysisReturnRelationshipsPointsInner.md b/docs/AnalysisReturnRelationshipsPointsInner.md deleted file mode 100644 index 65a275f..0000000 --- a/docs/AnalysisReturnRelationshipsPointsInner.md +++ /dev/null @@ -1,43 +0,0 @@ -# AnalysisReturnRelationshipsPointsInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**coordinates** | **List[float]** | Location of the significant coordinate in three dimensional space. | [optional] -**space** | **str** | Template space used to determine coordinate Examples include TAL or MNI. | [optional] -**kind** | **str** | Method of how point was derived (e.g., center of mass) | [optional] -**label_id** | **str** | If the point is associated with an image, this is the value the point takes in that image. | [optional] -**created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] -**updated_at** | **str** | when was the resource last modified/updated. | [optional] [readonly] -**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] -**user** | **str** | who owns the resource | [optional] [readonly] -**image** | **str** | | [optional] -**value** | [**PointRelationshipsValue**](PointRelationshipsValue.md) | | [optional] -**x** | **float** | | [optional] -**y** | **float** | | [optional] -**z** | **float** | | [optional] -**entities** | [**List[Entity]**](Entity.md) | | [optional] -**analysis** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.analysis_return_relationships_points_inner import AnalysisReturnRelationshipsPointsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnalysisReturnRelationshipsPointsInner from a JSON string -analysis_return_relationships_points_inner_instance = AnalysisReturnRelationshipsPointsInner.from_json(json) -# print the JSON string representation of the object -print AnalysisReturnRelationshipsPointsInner.to_json() - -# convert the object into a dict -analysis_return_relationships_points_inner_dict = analysis_return_relationships_points_inner_instance.to_dict() -# create an instance of AnalysisReturnRelationshipsPointsInner from a dict -analysis_return_relationships_points_inner_form_dict = analysis_return_relationships_points_inner.from_dict(analysis_return_relationships_points_inner_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) - - diff --git a/docs/AnnotationBase.md b/docs/AnnotationBase.md index 66d7692..47a84c6 100644 --- a/docs/AnnotationBase.md +++ b/docs/AnnotationBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Descriptive name for the annotation. | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of AnnotationBase from a JSON string annotation_base_instance = AnnotationBase.from_json(json) # print the JSON string representation of the object -print AnnotationBase.to_json() +print(AnnotationBase.to_json()) # convert the object into a dict annotation_base_dict = annotation_base_instance.to_dict() # create an instance of AnnotationBase from a dict -annotation_base_form_dict = annotation_base.from_dict(annotation_base_dict) +annotation_base_from_dict = AnnotationBase.from_dict(annotation_base_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) diff --git a/docs/AnnotationCommon.md b/docs/AnnotationCommon.md index 6de63d7..5554faf 100644 --- a/docs/AnnotationCommon.md +++ b/docs/AnnotationCommon.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **studyset** | **str** | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of AnnotationCommon from a JSON string annotation_common_instance = AnnotationCommon.from_json(json) # print the JSON string representation of the object -print AnnotationCommon.to_json() +print(AnnotationCommon.to_json()) # convert the object into a dict annotation_common_dict = annotation_common_instance.to_dict() # create an instance of AnnotationCommon from a dict -annotation_common_form_dict = annotation_common.from_dict(annotation_common_dict) +annotation_common_from_dict = AnnotationCommon.from_dict(annotation_common_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) diff --git a/docs/AnnotationExport.md b/docs/AnnotationExport.md index a87e81b..9268fa6 100644 --- a/docs/AnnotationExport.md +++ b/docs/AnnotationExport.md @@ -3,6 +3,7 @@ exporting an annotation as a CSV for easier editing ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] [readonly] @@ -18,12 +19,12 @@ json = "{}" # create an instance of AnnotationExport from a JSON string annotation_export_instance = AnnotationExport.from_json(json) # print the JSON string representation of the object -print AnnotationExport.to_json() +print(AnnotationExport.to_json()) # convert the object into a dict annotation_export_dict = annotation_export_instance.to_dict() # create an instance of AnnotationExport from a dict -annotation_export_form_dict = annotation_export.from_dict(annotation_export_dict) +annotation_export_from_dict = AnnotationExport.from_dict(annotation_export_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) diff --git a/docs/AnnotationList.md b/docs/AnnotationList.md index 90edc8f..0dc927e 100644 --- a/docs/AnnotationList.md +++ b/docs/AnnotationList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[AnnotationReturn]**](AnnotationReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of AnnotationList from a JSON string annotation_list_instance = AnnotationList.from_json(json) # print the JSON string representation of the object -print AnnotationList.to_json() +print(AnnotationList.to_json()) # convert the object into a dict annotation_list_dict = annotation_list_instance.to_dict() # create an instance of AnnotationList from a dict -annotation_list_form_dict = annotation_list.from_dict(annotation_list_dict) +annotation_list_from_dict = AnnotationList.from_dict(annotation_list_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) diff --git a/docs/AnnotationRequest.md b/docs/AnnotationRequest.md index 6e9b24c..56339b5 100644 --- a/docs/AnnotationRequest.md +++ b/docs/AnnotationRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation. | [optional] @@ -24,12 +25,12 @@ json = "{}" # create an instance of AnnotationRequest from a JSON string annotation_request_instance = AnnotationRequest.from_json(json) # print the JSON string representation of the object -print AnnotationRequest.to_json() +print(AnnotationRequest.to_json()) # convert the object into a dict annotation_request_dict = annotation_request_instance.to_dict() # create an instance of AnnotationRequest from a dict -annotation_request_form_dict = annotation_request.from_dict(annotation_request_dict) +annotation_request_from_dict = AnnotationRequest.from_dict(annotation_request_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) diff --git a/docs/AnnotationRequestOneOf.md b/docs/AnnotationRequestOneOf.md index c721b2d..a9b00a9 100644 --- a/docs/AnnotationRequestOneOf.md +++ b/docs/AnnotationRequestOneOf.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Descriptive name for the annotation. | [optional] @@ -23,12 +24,12 @@ json = "{}" # create an instance of AnnotationRequestOneOf from a JSON string annotation_request_one_of_instance = AnnotationRequestOneOf.from_json(json) # print the JSON string representation of the object -print AnnotationRequestOneOf.to_json() +print(AnnotationRequestOneOf.to_json()) # convert the object into a dict annotation_request_one_of_dict = annotation_request_one_of_instance.to_dict() # create an instance of AnnotationRequestOneOf from a dict -annotation_request_one_of_form_dict = annotation_request_one_of.from_dict(annotation_request_one_of_dict) +annotation_request_one_of_from_dict = AnnotationRequestOneOf.from_dict(annotation_request_one_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) diff --git a/docs/AnnotationRequestRelationships.md b/docs/AnnotationRequestRelationships.md index 1fa8fbc..f90276c 100644 --- a/docs/AnnotationRequestRelationships.md +++ b/docs/AnnotationRequestRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **notes** | [**AnnotationRequestRelationshipsNotes**](AnnotationRequestRelationshipsNotes.md) | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of AnnotationRequestRelationships from a JSON string annotation_request_relationships_instance = AnnotationRequestRelationships.from_json(json) # print the JSON string representation of the object -print AnnotationRequestRelationships.to_json() +print(AnnotationRequestRelationships.to_json()) # convert the object into a dict annotation_request_relationships_dict = annotation_request_relationships_instance.to_dict() # create an instance of AnnotationRequestRelationships from a dict -annotation_request_relationships_form_dict = annotation_request_relationships.from_dict(annotation_request_relationships_dict) +annotation_request_relationships_from_dict = AnnotationRequestRelationships.from_dict(annotation_request_relationships_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) diff --git a/docs/AnnotationRequestRelationshipsNotes.md b/docs/AnnotationRequestRelationshipsNotes.md index 89f1ba3..971d59a 100644 --- a/docs/AnnotationRequestRelationshipsNotes.md +++ b/docs/AnnotationRequestRelationshipsNotes.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnnotationRequestRelationshipsNotes from a JSON string annotation_request_relationships_notes_instance = AnnotationRequestRelationshipsNotes.from_json(json) # print the JSON string representation of the object -print AnnotationRequestRelationshipsNotes.to_json() +print(AnnotationRequestRelationshipsNotes.to_json()) # convert the object into a dict annotation_request_relationships_notes_dict = annotation_request_relationships_notes_instance.to_dict() # create an instance of AnnotationRequestRelationshipsNotes from a dict -annotation_request_relationships_notes_form_dict = annotation_request_relationships_notes.from_dict(annotation_request_relationships_notes_dict) +annotation_request_relationships_notes_from_dict = AnnotationRequestRelationshipsNotes.from_dict(annotation_request_relationships_notes_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) diff --git a/docs/AnnotationRequestRelationshipsNotesInner.md b/docs/AnnotationRequestRelationshipsNotesInner.md deleted file mode 100644 index 0779cd5..0000000 --- a/docs/AnnotationRequestRelationshipsNotesInner.md +++ /dev/null @@ -1,30 +0,0 @@ -# AnnotationRequestRelationshipsNotesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**note** | **object** | The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys. | [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] - -## Example - -```python -from neurostore_sdk.models.annotation_request_relationships_notes_inner import AnnotationRequestRelationshipsNotesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnnotationRequestRelationshipsNotesInner from a JSON string -annotation_request_relationships_notes_inner_instance = AnnotationRequestRelationshipsNotesInner.from_json(json) -# print the JSON string representation of the object -print AnnotationRequestRelationshipsNotesInner.to_json() - -# convert the object into a dict -annotation_request_relationships_notes_inner_dict = annotation_request_relationships_notes_inner_instance.to_dict() -# create an instance of AnnotationRequestRelationshipsNotesInner from a dict -annotation_request_relationships_notes_inner_form_dict = annotation_request_relationships_notes_inner.from_dict(annotation_request_relationships_notes_inner_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) - - diff --git a/docs/AnnotationReturn.md b/docs/AnnotationReturn.md index d1feb22..304b13b 100644 --- a/docs/AnnotationReturn.md +++ b/docs/AnnotationReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation. | [optional] @@ -31,12 +32,12 @@ json = "{}" # create an instance of AnnotationReturn from a JSON string annotation_return_instance = AnnotationReturn.from_json(json) # print the JSON string representation of the object -print AnnotationReturn.to_json() +print(AnnotationReturn.to_json()) # convert the object into a dict annotation_return_dict = annotation_return_instance.to_dict() # create an instance of AnnotationReturn from a dict -annotation_return_form_dict = annotation_return.from_dict(annotation_return_dict) +annotation_return_from_dict = AnnotationReturn.from_dict(annotation_return_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) diff --git a/docs/AnnotationReturnOneOf.md b/docs/AnnotationReturnOneOf.md index 727f35e..5ad1084 100644 --- a/docs/AnnotationReturnOneOf.md +++ b/docs/AnnotationReturnOneOf.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] [readonly] @@ -17,12 +18,12 @@ json = "{}" # create an instance of AnnotationReturnOneOf from a JSON string annotation_return_one_of_instance = AnnotationReturnOneOf.from_json(json) # print the JSON string representation of the object -print AnnotationReturnOneOf.to_json() +print(AnnotationReturnOneOf.to_json()) # convert the object into a dict annotation_return_one_of_dict = annotation_return_one_of_instance.to_dict() # create an instance of AnnotationReturnOneOf from a dict -annotation_return_one_of_form_dict = annotation_return_one_of.from_dict(annotation_return_one_of_dict) +annotation_return_one_of_from_dict = AnnotationReturnOneOf.from_dict(annotation_return_one_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) diff --git a/docs/AnnotationReturnOneOf1.md b/docs/AnnotationReturnOneOf1.md index 3095f27..eda7cd7 100644 --- a/docs/AnnotationReturnOneOf1.md +++ b/docs/AnnotationReturnOneOf1.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Descriptive name for the annotation. | [optional] @@ -30,12 +31,12 @@ json = "{}" # create an instance of AnnotationReturnOneOf1 from a JSON string annotation_return_one_of1_instance = AnnotationReturnOneOf1.from_json(json) # print the JSON string representation of the object -print AnnotationReturnOneOf1.to_json() +print(AnnotationReturnOneOf1.to_json()) # convert the object into a dict annotation_return_one_of1_dict = annotation_return_one_of1_instance.to_dict() # create an instance of AnnotationReturnOneOf1 from a dict -annotation_return_one_of1_form_dict = annotation_return_one_of1.from_dict(annotation_return_one_of1_dict) +annotation_return_one_of1_from_dict = AnnotationReturnOneOf1.from_dict(annotation_return_one_of1_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) diff --git a/docs/AnnotationReturnRelationships.md b/docs/AnnotationReturnRelationships.md index c0bec06..6ff4067 100644 --- a/docs/AnnotationReturnRelationships.md +++ b/docs/AnnotationReturnRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **notes** | [**AnnotationReturnRelationshipsNotes**](AnnotationReturnRelationshipsNotes.md) | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of AnnotationReturnRelationships from a JSON string annotation_return_relationships_instance = AnnotationReturnRelationships.from_json(json) # print the JSON string representation of the object -print AnnotationReturnRelationships.to_json() +print(AnnotationReturnRelationships.to_json()) # convert the object into a dict annotation_return_relationships_dict = annotation_return_relationships_instance.to_dict() # create an instance of AnnotationReturnRelationships from a dict -annotation_return_relationships_form_dict = annotation_return_relationships.from_dict(annotation_return_relationships_dict) +annotation_return_relationships_from_dict = AnnotationReturnRelationships.from_dict(annotation_return_relationships_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) diff --git a/docs/AnnotationReturnRelationshipsNotes.md b/docs/AnnotationReturnRelationshipsNotes.md index 06413bd..664d6da 100644 --- a/docs/AnnotationReturnRelationshipsNotes.md +++ b/docs/AnnotationReturnRelationshipsNotes.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of AnnotationReturnRelationshipsNotes from a JSON string annotation_return_relationships_notes_instance = AnnotationReturnRelationshipsNotes.from_json(json) # print the JSON string representation of the object -print AnnotationReturnRelationshipsNotes.to_json() +print(AnnotationReturnRelationshipsNotes.to_json()) # convert the object into a dict annotation_return_relationships_notes_dict = annotation_return_relationships_notes_instance.to_dict() # create an instance of AnnotationReturnRelationshipsNotes from a dict -annotation_return_relationships_notes_form_dict = annotation_return_relationships_notes.from_dict(annotation_return_relationships_notes_dict) +annotation_return_relationships_notes_from_dict = AnnotationReturnRelationshipsNotes.from_dict(annotation_return_relationships_notes_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) diff --git a/docs/AnnotationReturnRelationshipsNotesInner.md b/docs/AnnotationReturnRelationshipsNotesInner.md deleted file mode 100644 index 12b69b5..0000000 --- a/docs/AnnotationReturnRelationshipsNotesInner.md +++ /dev/null @@ -1,36 +0,0 @@ -# AnnotationReturnRelationshipsNotesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**note** | **object** | The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys. | [optional] -**analysis** | **str** | | [optional] [readonly] -**analysis_name** | **str** | | [optional] [readonly] -**study** | **str** | | [optional] [readonly] -**study_name** | **str** | | [optional] [readonly] -**annotation** | **str** | | [optional] [readonly] -**study_year** | **int** | | [optional] [readonly] -**publication** | **str** | | [optional] [readonly] -**authors** | **str** | | [optional] [readonly] - -## Example - -```python -from neurostore_sdk.models.annotation_return_relationships_notes_inner import AnnotationReturnRelationshipsNotesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AnnotationReturnRelationshipsNotesInner from a JSON string -annotation_return_relationships_notes_inner_instance = AnnotationReturnRelationshipsNotesInner.from_json(json) -# print the JSON string representation of the object -print AnnotationReturnRelationshipsNotesInner.to_json() - -# convert the object into a dict -annotation_return_relationships_notes_inner_dict = annotation_return_relationships_notes_inner_instance.to_dict() -# create an instance of AnnotationReturnRelationshipsNotesInner from a dict -annotation_return_relationships_notes_inner_form_dict = annotation_return_relationships_notes_inner.from_dict(annotation_return_relationships_notes_inner_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) - - diff --git a/docs/AnnotationsApi.md b/docs/AnnotationsApi.md index a610cee..6fa7e48 100644 --- a/docs/AnnotationsApi.md +++ b/docs/AnnotationsApi.md @@ -22,9 +22,8 @@ Get annotation analyses ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_list import NoteCollectionList from neurostore_sdk.rest import ApiException @@ -52,7 +51,9 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -69,6 +70,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -84,9 +86,8 @@ Your GET endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_return import NoteCollectionReturn from neurostore_sdk.rest import ApiException @@ -124,8 +125,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -144,6 +147,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -158,9 +162,8 @@ Your PUT endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn @@ -200,8 +203,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -221,6 +226,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -237,9 +243,8 @@ This endpoint does not allow for creation, only modification of existing annotat ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn @@ -278,8 +283,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **note_collection_request** | [**List[NoteCollectionRequest]**](NoteCollectionRequest.md)| | [optional] @@ -298,6 +305,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -313,9 +321,8 @@ get annotations for an available studyset ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_list import AnnotationList from neurostore_sdk.rest import ApiException @@ -344,8 +351,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_id** | **str**| see all annotations connected to this studyset | [optional] @@ -364,6 +373,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -380,9 +390,8 @@ delete annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -417,8 +426,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -437,6 +448,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -452,9 +464,8 @@ get an individual annotation ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_return import AnnotationReturn from neurostore_sdk.rest import ApiException @@ -484,8 +495,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -505,6 +518,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -521,9 +535,8 @@ edit an existing annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_request import AnnotationRequest from neurostore_sdk.models.annotation_return import AnnotationReturn @@ -563,8 +576,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -584,6 +599,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -600,9 +616,8 @@ Create an annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_request import AnnotationRequest from neurostore_sdk.models.annotation_return import AnnotationReturn @@ -629,7 +644,7 @@ configuration = neurostore_sdk.Configuration( with neurostore_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurostore_sdk.AnnotationsApi(api_client) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) annotation_request = neurostore_sdk.AnnotationRequest() # AnnotationRequest | (optional) @@ -643,11 +658,13 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **annotation_request** | [**AnnotationRequest**](AnnotationRequest.md)| | [optional] @@ -665,6 +682,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/BaseStudiesPost200Response.md b/docs/BaseStudiesPost200Response.md index f1d704c..43900ae 100644 --- a/docs/BaseStudiesPost200Response.md +++ b/docs/BaseStudiesPost200Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] @@ -32,12 +33,12 @@ json = "{}" # create an instance of BaseStudiesPost200Response from a JSON string base_studies_post200_response_instance = BaseStudiesPost200Response.from_json(json) # print the JSON string representation of the object -print BaseStudiesPost200Response.to_json() +print(BaseStudiesPost200Response.to_json()) # convert the object into a dict base_studies_post200_response_dict = base_studies_post200_response_instance.to_dict() # create an instance of BaseStudiesPost200Response from a dict -base_studies_post200_response_form_dict = base_studies_post200_response.from_dict(base_studies_post200_response_dict) +base_studies_post200_response_from_dict = BaseStudiesPost200Response.from_dict(base_studies_post200_response_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) diff --git a/docs/BaseStudiesPostRequest.md b/docs/BaseStudiesPostRequest.md index eac8fc2..7774268 100644 --- a/docs/BaseStudiesPostRequest.md +++ b/docs/BaseStudiesPostRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] @@ -26,12 +27,12 @@ json = "{}" # create an instance of BaseStudiesPostRequest from a JSON string base_studies_post_request_instance = BaseStudiesPostRequest.from_json(json) # print the JSON string representation of the object -print BaseStudiesPostRequest.to_json() +print(BaseStudiesPostRequest.to_json()) # convert the object into a dict base_studies_post_request_dict = base_studies_post_request_instance.to_dict() # create an instance of BaseStudiesPostRequest from a dict -base_studies_post_request_form_dict = base_studies_post_request.from_dict(base_studies_post_request_dict) +base_studies_post_request_from_dict = BaseStudiesPostRequest.from_dict(base_studies_post_request_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) diff --git a/docs/BaseStudy.md b/docs/BaseStudy.md index a799380..3952eaf 100644 --- a/docs/BaseStudy.md +++ b/docs/BaseStudy.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] @@ -26,12 +27,12 @@ json = "{}" # create an instance of BaseStudy from a JSON string base_study_instance = BaseStudy.from_json(json) # print the JSON string representation of the object -print BaseStudy.to_json() +print(BaseStudy.to_json()) # convert the object into a dict base_study_dict = base_study_instance.to_dict() # create an instance of BaseStudy from a dict -base_study_form_dict = base_study.from_dict(base_study_dict) +base_study_from_dict = BaseStudy.from_dict(base_study_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) diff --git a/docs/BaseStudyList.md b/docs/BaseStudyList.md index eaa25f8..bc30085 100644 --- a/docs/BaseStudyList.md +++ b/docs/BaseStudyList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[BaseStudyReturn]**](BaseStudyReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of BaseStudyList from a JSON string base_study_list_instance = BaseStudyList.from_json(json) # print the JSON string representation of the object -print BaseStudyList.to_json() +print(BaseStudyList.to_json()) # convert the object into a dict base_study_list_dict = base_study_list_instance.to_dict() # create an instance of BaseStudyList from a dict -base_study_list_form_dict = base_study_list.from_dict(base_study_list_dict) +base_study_list_from_dict = BaseStudyList.from_dict(base_study_list_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) diff --git a/docs/BaseStudyReturn.md b/docs/BaseStudyReturn.md index 6d697e7..2076734 100644 --- a/docs/BaseStudyReturn.md +++ b/docs/BaseStudyReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] @@ -32,12 +33,12 @@ json = "{}" # create an instance of BaseStudyReturn from a JSON string base_study_return_instance = BaseStudyReturn.from_json(json) # print the JSON string representation of the object -print BaseStudyReturn.to_json() +print(BaseStudyReturn.to_json()) # convert the object into a dict base_study_return_dict = base_study_return_instance.to_dict() # create an instance of BaseStudyReturn from a dict -base_study_return_form_dict = base_study_return.from_dict(base_study_return_dict) +base_study_return_from_dict = BaseStudyReturn.from_dict(base_study_return_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) diff --git a/docs/BaseStudyVersions.md b/docs/BaseStudyVersions.md index 7693a3f..9424d8b 100644 --- a/docs/BaseStudyVersions.md +++ b/docs/BaseStudyVersions.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of BaseStudyVersions from a JSON string base_study_versions_instance = BaseStudyVersions.from_json(json) # print the JSON string representation of the object -print BaseStudyVersions.to_json() +print(BaseStudyVersions.to_json()) # convert the object into a dict base_study_versions_dict = base_study_versions_instance.to_dict() # create an instance of BaseStudyVersions from a dict -base_study_versions_form_dict = base_study_versions.from_dict(base_study_versions_dict) +base_study_versions_from_dict = BaseStudyVersions.from_dict(base_study_versions_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) diff --git a/docs/Clone.md b/docs/Clone.md index 9b72312..501d9d1 100644 --- a/docs/Clone.md +++ b/docs/Clone.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **source** | **str** | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of Clone from a JSON string clone_instance = Clone.from_json(json) # print the JSON string representation of the object -print Clone.to_json() +print(Clone.to_json()) # convert the object into a dict clone_dict = clone_instance.to_dict() # create an instance of Clone from a dict -clone_form_dict = clone.from_dict(clone_dict) +clone_from_dict = Clone.from_dict(clone_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) diff --git a/docs/ConditionBase.md b/docs/ConditionBase.md index c7f1c82..83952be 100644 --- a/docs/ConditionBase.md +++ b/docs/ConditionBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the condition being applied in the contrast, either psychological, pharmacological, or group based. | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of ConditionBase from a JSON string condition_base_instance = ConditionBase.from_json(json) # print the JSON string representation of the object -print ConditionBase.to_json() +print(ConditionBase.to_json()) # convert the object into a dict condition_base_dict = condition_base_instance.to_dict() # create an instance of ConditionBase from a dict -condition_base_form_dict = condition_base.from_dict(condition_base_dict) +condition_base_from_dict = ConditionBase.from_dict(condition_base_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) diff --git a/docs/ConditionList.md b/docs/ConditionList.md index 16c998a..598d0e0 100644 --- a/docs/ConditionList.md +++ b/docs/ConditionList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[ConditionReturn]**](ConditionReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of ConditionList from a JSON string condition_list_instance = ConditionList.from_json(json) # print the JSON string representation of the object -print ConditionList.to_json() +print(ConditionList.to_json()) # convert the object into a dict condition_list_dict = condition_list_instance.to_dict() # create an instance of ConditionList from a dict -condition_list_form_dict = condition_list.from_dict(condition_list_dict) +condition_list_from_dict = ConditionList.from_dict(condition_list_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) diff --git a/docs/ConditionRequest.md b/docs/ConditionRequest.md index a757e64..a6f4528 100644 --- a/docs/ConditionRequest.md +++ b/docs/ConditionRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the condition being applied in the contrast, either psychological, pharmacological, or group based. | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of ConditionRequest from a JSON string condition_request_instance = ConditionRequest.from_json(json) # print the JSON string representation of the object -print ConditionRequest.to_json() +print(ConditionRequest.to_json()) # convert the object into a dict condition_request_dict = condition_request_instance.to_dict() # create an instance of ConditionRequest from a dict -condition_request_form_dict = condition_request.from_dict(condition_request_dict) +condition_request_from_dict = ConditionRequest.from_dict(condition_request_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) diff --git a/docs/ConditionReturn.md b/docs/ConditionReturn.md index 5940eac..be54e41 100644 --- a/docs/ConditionReturn.md +++ b/docs/ConditionReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the condition being applied in the contrast, either psychological, pharmacological, or group based. | [optional] @@ -23,12 +24,12 @@ json = "{}" # create an instance of ConditionReturn from a JSON string condition_return_instance = ConditionReturn.from_json(json) # print the JSON string representation of the object -print ConditionReturn.to_json() +print(ConditionReturn.to_json()) # convert the object into a dict condition_return_dict = condition_return_instance.to_dict() # create an instance of ConditionReturn from a dict -condition_return_form_dict = condition_return.from_dict(condition_return_dict) +condition_return_from_dict = ConditionReturn.from_dict(condition_return_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) diff --git a/docs/ConditionsApi.md b/docs/ConditionsApi.md index 0e7e873..ece1187 100644 --- a/docs/ConditionsApi.md +++ b/docs/ConditionsApi.md @@ -20,9 +20,8 @@ Get all conditions ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_list import ConditionList from neurostore_sdk.rest import ApiException @@ -57,8 +56,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -83,6 +84,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -99,9 +101,8 @@ delete a condition ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -136,8 +137,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -156,6 +159,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -171,9 +175,8 @@ Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_return import ConditionReturn from neurostore_sdk.rest import ApiException @@ -202,8 +205,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -222,6 +227,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -239,9 +245,8 @@ update a condition ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_request import ConditionRequest from neurostore_sdk.models.condition_return import ConditionReturn @@ -281,8 +286,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -302,6 +309,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -319,9 +327,8 @@ Create a condition ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_request import ConditionRequest from neurostore_sdk.models.condition_return import ConditionReturn @@ -360,8 +367,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **condition_request** | [**ConditionRequest**](ConditionRequest.md)| | [optional] @@ -380,6 +389,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md deleted file mode 100644 index 227d8d1..0000000 --- a/docs/DefaultApi.md +++ /dev/null @@ -1,334 +0,0 @@ -# neurostore_sdk.DefaultApi - -All URIs are relative to *https://neurostore.org/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**base_studies_get**](DefaultApi.md#base_studies_get) | **GET** /base-studies/ | -[**base_studies_id_get**](DefaultApi.md#base_studies_id_get) | **GET** /base-studies/{id} | Your GET endpoint -[**base_studies_id_put**](DefaultApi.md#base_studies_id_put) | **PUT** /base-studies/{id} | -[**base_studies_post**](DefaultApi.md#base_studies_post) | **POST** /base-studies/ | - - -# **base_studies_get** -> BaseStudyList base_studies_get(search=search, sort=sort, page=page, desc=desc, page_size=page_size, name=name, description=description, authors=authors, level=level, data_type=data_type, publication=publication, pmid=pmid, doi=doi, flat=flat, info=info) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurostore_sdk -from neurostore_sdk.models.base_study_list import BaseStudyList -from neurostore_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://neurostore.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurostore_sdk.Configuration( - host = "https://neurostore.org/api" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization: JSON-Web-Token -configuration = neurostore_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurostore_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurostore_sdk.DefaultApi(api_client) - search = 'imagin' # str | search for entries that contain the substring (optional) - sort = 'created_at' # str | Parameter to sort results on (optional) (default to 'created_at') - page = 56 # int | page of results (optional) - desc = True # bool | sort results by descending order (as opposed to ascending order) (optional) - page_size = 56 # int | number of results to show on a page (optional) - name = 'name_example' # str | search the name field for a term (optional) - description = 'description_example' # str | search description field for a term (optional) - authors = 'authors_example' # str | search authors (optional) - level = 'group' # str | select between studies with group results or meta results (optional) (default to 'group') - data_type = 'data_type_example' # str | whether searching for studies that contain coordinates, images, or both (optional) - publication = 'publication_example' # str | search for papers from a particular journal (optional) - pmid = 'pmid_example' # str | search for particular pmid (optional) - doi = 'doi_example' # str | search for study with specific doi (optional) - flat = True # bool | do not return any embedded relationships. When set, it is incompatible with nested. (optional) - info = True # bool | show additional for endpoint-object relationships without being fully nested. Incompatible with nested (optional) - - try: - # - api_response = api_instance.base_studies_get(search=search, sort=sort, page=page, desc=desc, page_size=page_size, name=name, description=description, authors=authors, level=level, data_type=data_type, publication=publication, pmid=pmid, doi=doi, flat=flat, info=info) - print("The response of DefaultApi->base_studies_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->base_studies_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **search** | **str**| search for entries that contain the substring | [optional] - **sort** | **str**| Parameter to sort results on | [optional] [default to 'created_at'] - **page** | **int**| page of results | [optional] - **desc** | **bool**| sort results by descending order (as opposed to ascending order) | [optional] - **page_size** | **int**| number of results to show on a page | [optional] - **name** | **str**| search the name field for a term | [optional] - **description** | **str**| search description field for a term | [optional] - **authors** | **str**| search authors | [optional] - **level** | **str**| select between studies with group results or meta results | [optional] [default to 'group'] - **data_type** | **str**| whether searching for studies that contain coordinates, images, or both | [optional] - **publication** | **str**| search for papers from a particular journal | [optional] - **pmid** | **str**| search for particular pmid | [optional] - **doi** | **str**| search for study with specific doi | [optional] - **flat** | **bool**| do not return any embedded relationships. When set, it is incompatible with nested. | [optional] - **info** | **bool**| show additional for endpoint-object relationships without being fully nested. Incompatible with nested | [optional] - -### Return type - -[**BaseStudyList**](BaseStudyList.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **base_studies_id_get** -> BaseStudyReturn base_studies_id_get(id, flat=flat, info=info) - -Your GET endpoint - -### Example - -```python -import time -import os -import neurostore_sdk -from neurostore_sdk.models.base_study_return import BaseStudyReturn -from neurostore_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://neurostore.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurostore_sdk.Configuration( - host = "https://neurostore.org/api" -) - - -# Enter a context with an instance of the API client -with neurostore_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurostore_sdk.DefaultApi(api_client) - id = 'id_example' # str | - flat = True # bool | do not return any embedded relationships. When set, it is incompatible with nested. (optional) - info = True # bool | show additional for endpoint-object relationships without being fully nested. Incompatible with nested (optional) - - try: - # Your GET endpoint - api_response = api_instance.base_studies_id_get(id, flat=flat, info=info) - print("The response of DefaultApi->base_studies_id_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->base_studies_id_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **flat** | **bool**| do not return any embedded relationships. When set, it is incompatible with nested. | [optional] - **info** | **bool**| show additional for endpoint-object relationships without being fully nested. Incompatible with nested | [optional] - -### Return type - -[**BaseStudyReturn**](BaseStudyReturn.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **base_studies_id_put** -> BaseStudyReturn base_studies_id_put(id, base_study=base_study) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurostore_sdk -from neurostore_sdk.models.base_study import BaseStudy -from neurostore_sdk.models.base_study_return import BaseStudyReturn -from neurostore_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://neurostore.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurostore_sdk.Configuration( - host = "https://neurostore.org/api" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization: JSON-Web-Token -configuration = neurostore_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurostore_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurostore_sdk.DefaultApi(api_client) - id = 'id_example' # str | - base_study = neurostore_sdk.BaseStudy() # BaseStudy | (optional) - - try: - # - api_response = api_instance.base_studies_id_put(id, base_study=base_study) - print("The response of DefaultApi->base_studies_id_put:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->base_studies_id_put: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **base_study** | [**BaseStudy**](BaseStudy.md)| | [optional] - -### Return type - -[**BaseStudyReturn**](BaseStudyReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **base_studies_post** -> BaseStudiesPost200Response base_studies_post(base_studies_post_request=base_studies_post_request) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurostore_sdk -from neurostore_sdk.models.base_studies_post200_response import BaseStudiesPost200Response -from neurostore_sdk.models.base_studies_post_request import BaseStudiesPostRequest -from neurostore_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://neurostore.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurostore_sdk.Configuration( - host = "https://neurostore.org/api" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization: JSON-Web-Token -configuration = neurostore_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurostore_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurostore_sdk.DefaultApi(api_client) - base_studies_post_request = neurostore_sdk.BaseStudiesPostRequest() # BaseStudiesPostRequest | (optional) - - try: - # - api_response = api_instance.base_studies_post(base_studies_post_request=base_studies_post_request) - print("The response of DefaultApi->base_studies_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->base_studies_post: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **base_studies_post_request** | [**BaseStudiesPostRequest**](BaseStudiesPostRequest.md)| | [optional] - -### Return type - -[**BaseStudiesPost200Response**](BaseStudiesPost200Response.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/docs/Entity.md b/docs/Entity.md index 2312443..0af370e 100644 --- a/docs/Entity.md +++ b/docs/Entity.md @@ -3,6 +3,7 @@ WARNING: not currently used. descriptor of level of analysis for a particular image/point (run, session, subject, group, meta) ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **label** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of Entity from a JSON string entity_instance = Entity.from_json(json) # print the JSON string representation of the object -print Entity.to_json() +print(Entity.to_json()) # convert the object into a dict entity_dict = entity_instance.to_dict() # create an instance of Entity from a dict -entity_form_dict = entity.from_dict(entity_dict) +entity_from_dict = Entity.from_dict(entity_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) diff --git a/docs/EntityAllOf.md b/docs/EntityAllOf.md deleted file mode 100644 index a665ac5..0000000 --- a/docs/EntityAllOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# EntityAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**label** | **str** | | [optional] -**level** | **str** | | [optional] -**analysis** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.entity_all_of import EntityAllOf - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityAllOf from a JSON string -entity_all_of_instance = EntityAllOf.from_json(json) -# print the JSON string representation of the object -print EntityAllOf.to_json() - -# convert the object into a dict -entity_all_of_dict = entity_all_of_instance.to_dict() -# create an instance of EntityAllOf from a dict -entity_all_of_form_dict = entity_all_of.from_dict(entity_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) - - diff --git a/docs/ImageBase.md b/docs/ImageBase.md index f5467a1..26b2925 100644 --- a/docs/ImageBase.md +++ b/docs/ImageBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | Metadata about image such as software and version used and other relevant data about how the image was produced. | [optional] @@ -21,12 +22,12 @@ json = "{}" # create an instance of ImageBase from a JSON string image_base_instance = ImageBase.from_json(json) # print the JSON string representation of the object -print ImageBase.to_json() +print(ImageBase.to_json()) # convert the object into a dict image_base_dict = image_base_instance.to_dict() # create an instance of ImageBase from a dict -image_base_form_dict = image_base.from_dict(image_base_dict) +image_base_from_dict = ImageBase.from_dict(image_base_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) diff --git a/docs/ImageCommon.md b/docs/ImageCommon.md index 3a3ef41..7a44f4b 100644 --- a/docs/ImageCommon.md +++ b/docs/ImageCommon.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **analysis** | **str** | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of ImageCommon from a JSON string image_common_instance = ImageCommon.from_json(json) # print the JSON string representation of the object -print ImageCommon.to_json() +print(ImageCommon.to_json()) # convert the object into a dict image_common_dict = image_common_instance.to_dict() # create an instance of ImageCommon from a dict -image_common_form_dict = image_common.from_dict(image_common_dict) +image_common_from_dict = ImageCommon.from_dict(image_common_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) diff --git a/docs/ImageList.md b/docs/ImageList.md index 5d2a74e..52cff5a 100644 --- a/docs/ImageList.md +++ b/docs/ImageList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[ImageReturn]**](ImageReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of ImageList from a JSON string image_list_instance = ImageList.from_json(json) # print the JSON string representation of the object -print ImageList.to_json() +print(ImageList.to_json()) # convert the object into a dict image_list_dict = image_list_instance.to_dict() # create an instance of ImageList from a dict -image_list_form_dict = image_list.from_dict(image_list_dict) +image_list_from_dict = ImageList.from_dict(image_list_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) diff --git a/docs/ImageRelationships.md b/docs/ImageRelationships.md index fff1dc0..dcdd71b 100644 --- a/docs/ImageRelationships.md +++ b/docs/ImageRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **analysis** | **str** | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of ImageRelationships from a JSON string image_relationships_instance = ImageRelationships.from_json(json) # print the JSON string representation of the object -print ImageRelationships.to_json() +print(ImageRelationships.to_json()) # convert the object into a dict image_relationships_dict = image_relationships_instance.to_dict() # create an instance of ImageRelationships from a dict -image_relationships_form_dict = image_relationships.from_dict(image_relationships_dict) +image_relationships_from_dict = ImageRelationships.from_dict(image_relationships_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) diff --git a/docs/ImageRequest.md b/docs/ImageRequest.md index b18b49e..a1cf071 100644 --- a/docs/ImageRequest.md +++ b/docs/ImageRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | Metadata about image such as software and version used and other relevant data about how the image was produced. | [optional] @@ -26,12 +27,12 @@ json = "{}" # create an instance of ImageRequest from a JSON string image_request_instance = ImageRequest.from_json(json) # print the JSON string representation of the object -print ImageRequest.to_json() +print(ImageRequest.to_json()) # convert the object into a dict image_request_dict = image_request_instance.to_dict() # create an instance of ImageRequest from a dict -image_request_form_dict = image_request.from_dict(image_request_dict) +image_request_from_dict = ImageRequest.from_dict(image_request_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) diff --git a/docs/ImageReturn.md b/docs/ImageReturn.md index da1aecb..d2bbad2 100644 --- a/docs/ImageReturn.md +++ b/docs/ImageReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | Metadata about image such as software and version used and other relevant data about how the image was produced. | [optional] @@ -30,12 +31,12 @@ json = "{}" # create an instance of ImageReturn from a JSON string image_return_instance = ImageReturn.from_json(json) # print the JSON string representation of the object -print ImageReturn.to_json() +print(ImageReturn.to_json()) # convert the object into a dict image_return_dict = image_return_instance.to_dict() # create an instance of ImageReturn from a dict -image_return_form_dict = image_return.from_dict(image_return_dict) +image_return_from_dict = ImageReturn.from_dict(image_return_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) diff --git a/docs/ImagesApi.md b/docs/ImagesApi.md index 22b8090..37ce84f 100644 --- a/docs/ImagesApi.md +++ b/docs/ImagesApi.md @@ -20,9 +20,8 @@ Retrieve and list images. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_list import ImageList from neurostore_sdk.rest import ApiException @@ -59,8 +58,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -87,6 +88,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -103,9 +105,8 @@ delete an image ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -140,8 +141,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -160,6 +163,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -175,9 +179,8 @@ Retrieve information about a particular image from an analysis. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_return import ImageReturn from neurostore_sdk.rest import ApiException @@ -206,8 +209,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -226,6 +231,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -243,9 +249,8 @@ Update a specific image. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn @@ -285,8 +290,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -306,6 +313,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -323,9 +331,8 @@ Create an image ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn @@ -364,8 +371,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **image_request** | [**ImageRequest**](ImageRequest.md)| | [optional] @@ -384,6 +393,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/JsonLd.md b/docs/JsonLd.md deleted file mode 100644 index a6dd3db..0000000 --- a/docs/JsonLd.md +++ /dev/null @@ -1,31 +0,0 @@ -# JsonLd - -JSON-LD elements for data tracking - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**context** | [**JsonLdContext**](JsonLdContext.md) | | [optional] -**id** | **str** | URI of the resource | [optional] -**type** | **str** | One of the NiMADS data types | [optional] - -## Example - -```python -from neurostore_sdk.models.json_ld import JsonLd - -# TODO update the JSON string below -json = "{}" -# create an instance of JsonLd from a JSON string -json_ld_instance = JsonLd.from_json(json) -# print the JSON string representation of the object -print JsonLd.to_json() - -# convert the object into a dict -json_ld_dict = json_ld_instance.to_dict() -# create an instance of JsonLd from a dict -json_ld_form_dict = json_ld.from_dict(json_ld_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) - - diff --git a/docs/JsonLdContext.md b/docs/JsonLdContext.md index e2844ee..e774f56 100644 --- a/docs/JsonLdContext.md +++ b/docs/JsonLdContext.md @@ -3,6 +3,7 @@ Context for the shorthand names ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **vocab** | **str** | common URI prefix for @type | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of JsonLdContext from a JSON string json_ld_context_instance = JsonLdContext.from_json(json) # print the JSON string representation of the object -print JsonLdContext.to_json() +print(JsonLdContext.to_json()) # convert the object into a dict json_ld_context_dict = json_ld_context_instance.to_dict() # create an instance of JsonLdContext from a dict -json_ld_context_form_dict = json_ld_context.from_dict(json_ld_context_dict) +json_ld_context_from_dict = JsonLdContext.from_dict(json_ld_context_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) diff --git a/docs/Metadata.md b/docs/Metadata.md deleted file mode 100644 index 59b06bd..0000000 --- a/docs/Metadata.md +++ /dev/null @@ -1,30 +0,0 @@ -# Metadata - -data included in every list response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_count** | **int** | total number of entries | [optional] [readonly] -**unique_count** | **int** | count of elements for unique entries | [optional] [readonly] - -## Example - -```python -from neurostore_sdk.models.metadata import Metadata - -# TODO update the JSON string below -json = "{}" -# create an instance of Metadata from a JSON string -metadata_instance = Metadata.from_json(json) -# print the JSON string representation of the object -print Metadata.to_json() - -# convert the object into a dict -metadata_dict = metadata_instance.to_dict() -# create an instance of Metadata from a dict -metadata_form_dict = metadata.from_dict(metadata_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) - - diff --git a/docs/NestedPutAttributes.md b/docs/NestedPutAttributes.md index 0ad46b1..eb01904 100644 --- a/docs/NestedPutAttributes.md +++ b/docs/NestedPutAttributes.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of NestedPutAttributes from a JSON string nested_put_attributes_instance = NestedPutAttributes.from_json(json) # print the JSON string representation of the object -print NestedPutAttributes.to_json() +print(NestedPutAttributes.to_json()) # convert the object into a dict nested_put_attributes_dict = nested_put_attributes_instance.to_dict() # create an instance of NestedPutAttributes from a dict -nested_put_attributes_form_dict = nested_put_attributes.from_dict(nested_put_attributes_dict) +nested_put_attributes_from_dict = NestedPutAttributes.from_dict(nested_put_attributes_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) diff --git a/docs/NoteCollectionBase.md b/docs/NoteCollectionBase.md index d578b45..0c59862 100644 --- a/docs/NoteCollectionBase.md +++ b/docs/NoteCollectionBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | **object** | The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys. | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of NoteCollectionBase from a JSON string note_collection_base_instance = NoteCollectionBase.from_json(json) # print the JSON string representation of the object -print NoteCollectionBase.to_json() +print(NoteCollectionBase.to_json()) # convert the object into a dict note_collection_base_dict = note_collection_base_instance.to_dict() # create an instance of NoteCollectionBase from a dict -note_collection_base_form_dict = note_collection_base.from_dict(note_collection_base_dict) +note_collection_base_from_dict = NoteCollectionBase.from_dict(note_collection_base_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) diff --git a/docs/NoteCollectionList.md b/docs/NoteCollectionList.md index 9d1d594..ccb0d38 100644 --- a/docs/NoteCollectionList.md +++ b/docs/NoteCollectionList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[NoteCollectionReturn]**](NoteCollectionReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of NoteCollectionList from a JSON string note_collection_list_instance = NoteCollectionList.from_json(json) # print the JSON string representation of the object -print NoteCollectionList.to_json() +print(NoteCollectionList.to_json()) # convert the object into a dict note_collection_list_dict = note_collection_list_instance.to_dict() # create an instance of NoteCollectionList from a dict -note_collection_list_form_dict = note_collection_list.from_dict(note_collection_list_dict) +note_collection_list_from_dict = NoteCollectionList.from_dict(note_collection_list_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) diff --git a/docs/NoteCollectionRequest.md b/docs/NoteCollectionRequest.md index 245b2eb..8c059d5 100644 --- a/docs/NoteCollectionRequest.md +++ b/docs/NoteCollectionRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | **object** | The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys. | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of NoteCollectionRequest from a JSON string note_collection_request_instance = NoteCollectionRequest.from_json(json) # print the JSON string representation of the object -print NoteCollectionRequest.to_json() +print(NoteCollectionRequest.to_json()) # convert the object into a dict note_collection_request_dict = note_collection_request_instance.to_dict() # create an instance of NoteCollectionRequest from a dict -note_collection_request_form_dict = note_collection_request.from_dict(note_collection_request_dict) +note_collection_request_from_dict = NoteCollectionRequest.from_dict(note_collection_request_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) diff --git a/docs/NoteCollectionReturn.md b/docs/NoteCollectionReturn.md index afa1716..3bcc8c3 100644 --- a/docs/NoteCollectionReturn.md +++ b/docs/NoteCollectionReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | **object** | The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys. | [optional] @@ -25,12 +26,12 @@ json = "{}" # create an instance of NoteCollectionReturn from a JSON string note_collection_return_instance = NoteCollectionReturn.from_json(json) # print the JSON string representation of the object -print NoteCollectionReturn.to_json() +print(NoteCollectionReturn.to_json()) # convert the object into a dict note_collection_return_dict = note_collection_return_instance.to_dict() # create an instance of NoteCollectionReturn from a dict -note_collection_return_form_dict = note_collection_return.from_dict(note_collection_return_dict) +note_collection_return_from_dict = NoteCollectionReturn.from_dict(note_collection_return_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) diff --git a/docs/NoteCollectionReturnAllOf.md b/docs/NoteCollectionReturnAllOf.md deleted file mode 100644 index f532f61..0000000 --- a/docs/NoteCollectionReturnAllOf.md +++ /dev/null @@ -1,36 +0,0 @@ -# NoteCollectionReturnAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**analysis** | **str** | | [optional] [readonly] -**analysis_name** | **str** | | [optional] [readonly] -**study** | **str** | | [optional] [readonly] -**study_name** | **str** | | [optional] [readonly] -**annotation** | **str** | | [optional] [readonly] -**study_year** | **int** | | [optional] [readonly] -**publication** | **str** | | [optional] [readonly] -**authors** | **str** | | [optional] [readonly] -**id** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.note_collection_return_all_of import NoteCollectionReturnAllOf - -# TODO update the JSON string below -json = "{}" -# create an instance of NoteCollectionReturnAllOf from a JSON string -note_collection_return_all_of_instance = NoteCollectionReturnAllOf.from_json(json) -# print the JSON string representation of the object -print NoteCollectionReturnAllOf.to_json() - -# convert the object into a dict -note_collection_return_all_of_dict = note_collection_return_all_of_instance.to_dict() -# create an instance of NoteCollectionReturnAllOf from a dict -note_collection_return_all_of_form_dict = note_collection_return_all_of.from_dict(note_collection_return_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) - - diff --git a/docs/Pipeline.md b/docs/Pipeline.md new file mode 100644 index 0000000..f43c2c7 --- /dev/null +++ b/docs/Pipeline.md @@ -0,0 +1,36 @@ +# Pipeline + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**name** | **str** | | [optional] +**description** | **str** | | [optional] +**version** | **str** | | [optional] +**study_dependent** | **bool** | | [optional] +**ace_compatible** | **bool** | | [optional] +**pubget_compatible** | **bool** | | [optional] +**derived_from** | **str** | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline import Pipeline + +# TODO update the JSON string below +json = "{}" +# create an instance of Pipeline from a JSON string +pipeline_instance = Pipeline.from_json(json) +# print the JSON string representation of the object +print(Pipeline.to_json()) + +# convert the object into a dict +pipeline_dict = pipeline_instance.to_dict() +# create an instance of Pipeline from a dict +pipeline_from_dict = Pipeline.from_dict(pipeline_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) + + diff --git a/docs/PipelineConfig.md b/docs/PipelineConfig.md new file mode 100644 index 0000000..f530c13 --- /dev/null +++ b/docs/PipelineConfig.md @@ -0,0 +1,30 @@ +# PipelineConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**config** | **object** | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_config import PipelineConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineConfig from a JSON string +pipeline_config_instance = PipelineConfig.from_json(json) +# print the JSON string representation of the object +print(PipelineConfig.to_json()) + +# convert the object into a dict +pipeline_config_dict = pipeline_config_instance.to_dict() +# create an instance of PipelineConfig from a dict +pipeline_config_from_dict = PipelineConfig.from_dict(pipeline_config_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) + + diff --git a/docs/PipelineConfigList.md b/docs/PipelineConfigList.md new file mode 100644 index 0000000..9cc99aa --- /dev/null +++ b/docs/PipelineConfigList.md @@ -0,0 +1,30 @@ +# PipelineConfigList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PipelineConfig]**](PipelineConfig.md) | | [optional] +**metadata** | [**Metadata**](Metadata.md) | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_config_list import PipelineConfigList + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineConfigList from a JSON string +pipeline_config_list_instance = PipelineConfigList.from_json(json) +# print the JSON string representation of the object +print(PipelineConfigList.to_json()) + +# convert the object into a dict +pipeline_config_list_dict = pipeline_config_list_instance.to_dict() +# create an instance of PipelineConfigList from a dict +pipeline_config_list_from_dict = PipelineConfigList.from_dict(pipeline_config_list_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) + + diff --git a/docs/PipelineConfigsApi.md b/docs/PipelineConfigsApi.md new file mode 100644 index 0000000..f7e3bc7 --- /dev/null +++ b/docs/PipelineConfigsApi.md @@ -0,0 +1,334 @@ +# neurostore_sdk.PipelineConfigsApi + +All URIs are relative to *https://neurostore.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pipeline_configs_get**](PipelineConfigsApi.md#pipeline_configs_get) | **GET** /pipeline-configs/ | GET a list of pipeline configs +[**pipeline_configs_id_delete**](PipelineConfigsApi.md#pipeline_configs_id_delete) | **DELETE** /pipeline-configs/{id} | DELETE a pipeline config by ID +[**pipeline_configs_id_get**](PipelineConfigsApi.md#pipeline_configs_id_get) | **GET** /pipeline-configs/{id} | GET a pipeline config by ID +[**pipeline_configs_id_put**](PipelineConfigsApi.md#pipeline_configs_id_put) | **PUT** /pipeline-configs/{id} | PUT/update a pipeline config by ID +[**pipeline_configs_post**](PipelineConfigsApi.md#pipeline_configs_post) | **POST** /pipeline-configs/ | POST/create a pipeline config + + +# **pipeline_configs_get** +> PipelineConfigList pipeline_configs_get() + +GET a list of pipeline configs + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_config_list import PipelineConfigList +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineConfigsApi(api_client) + + try: + # GET a list of pipeline configs + api_response = api_instance.pipeline_configs_get() + print("The response of PipelineConfigsApi->pipeline_configs_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineConfigsApi->pipeline_configs_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**PipelineConfigList**](PipelineConfigList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_configs_id_delete** +> pipeline_configs_id_delete(id) + +DELETE a pipeline config by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineConfigsApi(api_client) + id = 'id_example' # str | + + try: + # DELETE a pipeline config by ID + api_instance.pipeline_configs_id_delete(id) + except Exception as e: + print("Exception when calling PipelineConfigsApi->pipeline_configs_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_configs_id_get** +> PipelineConfig pipeline_configs_id_get(id) + +GET a pipeline config by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_config import PipelineConfig +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineConfigsApi(api_client) + id = 'id_example' # str | + + try: + # GET a pipeline config by ID + api_response = api_instance.pipeline_configs_id_get(id) + print("The response of PipelineConfigsApi->pipeline_configs_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineConfigsApi->pipeline_configs_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**PipelineConfig**](PipelineConfig.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_configs_id_put** +> pipeline_configs_id_put(id, pipeline_config=pipeline_config) + +PUT/update a pipeline config by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_config import PipelineConfig +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineConfigsApi(api_client) + id = 'id_example' # str | + pipeline_config = neurostore_sdk.PipelineConfig() # PipelineConfig | (optional) + + try: + # PUT/update a pipeline config by ID + api_instance.pipeline_configs_id_put(id, pipeline_config=pipeline_config) + except Exception as e: + print("Exception when calling PipelineConfigsApi->pipeline_configs_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **pipeline_config** | [**PipelineConfig**](PipelineConfig.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_configs_post** +> pipeline_configs_post(pipeline_config=pipeline_config) + +POST/create a pipeline config + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_config import PipelineConfig +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineConfigsApi(api_client) + pipeline_config = neurostore_sdk.PipelineConfig() # PipelineConfig | (optional) + + try: + # POST/create a pipeline config + api_instance.pipeline_configs_post(pipeline_config=pipeline_config) + except Exception as e: + print("Exception when calling PipelineConfigsApi->pipeline_configs_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_config** | [**PipelineConfig**](PipelineConfig.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/PipelineList.md b/docs/PipelineList.md new file mode 100644 index 0000000..03d1f24 --- /dev/null +++ b/docs/PipelineList.md @@ -0,0 +1,30 @@ +# PipelineList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[Pipeline]**](Pipeline.md) | | [optional] +**metadata** | [**Metadata**](Metadata.md) | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_list import PipelineList + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineList from a JSON string +pipeline_list_instance = PipelineList.from_json(json) +# print the JSON string representation of the object +print(PipelineList.to_json()) + +# convert the object into a dict +pipeline_list_dict = pipeline_list_instance.to_dict() +# create an instance of PipelineList from a dict +pipeline_list_from_dict = PipelineList.from_dict(pipeline_list_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) + + diff --git a/docs/PipelineRun.md b/docs/PipelineRun.md new file mode 100644 index 0000000..28d3af3 --- /dev/null +++ b/docs/PipelineRun.md @@ -0,0 +1,32 @@ +# PipelineRun + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**status** | **str** | | [optional] +**started_at** | **str** | | [optional] +**finished_at** | **str** | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_run import PipelineRun + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineRun from a JSON string +pipeline_run_instance = PipelineRun.from_json(json) +# print the JSON string representation of the object +print(PipelineRun.to_json()) + +# convert the object into a dict +pipeline_run_dict = pipeline_run_instance.to_dict() +# create an instance of PipelineRun from a dict +pipeline_run_from_dict = PipelineRun.from_dict(pipeline_run_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) + + diff --git a/docs/PipelineRunList.md b/docs/PipelineRunList.md new file mode 100644 index 0000000..70302dd --- /dev/null +++ b/docs/PipelineRunList.md @@ -0,0 +1,30 @@ +# PipelineRunList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PipelineRun]**](PipelineRun.md) | | [optional] +**metadata** | [**Metadata**](Metadata.md) | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_run_list import PipelineRunList + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineRunList from a JSON string +pipeline_run_list_instance = PipelineRunList.from_json(json) +# print the JSON string representation of the object +print(PipelineRunList.to_json()) + +# convert the object into a dict +pipeline_run_list_dict = pipeline_run_list_instance.to_dict() +# create an instance of PipelineRunList from a dict +pipeline_run_list_from_dict = PipelineRunList.from_dict(pipeline_run_list_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) + + diff --git a/docs/PipelineRunResult.md b/docs/PipelineRunResult.md new file mode 100644 index 0000000..2e382f1 --- /dev/null +++ b/docs/PipelineRunResult.md @@ -0,0 +1,31 @@ +# PipelineRunResult + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**pipeline_run_id** | **str** | | [optional] +**data** | **object** | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineRunResult from a JSON string +pipeline_run_result_instance = PipelineRunResult.from_json(json) +# print the JSON string representation of the object +print(PipelineRunResult.to_json()) + +# convert the object into a dict +pipeline_run_result_dict = pipeline_run_result_instance.to_dict() +# create an instance of PipelineRunResult from a dict +pipeline_run_result_from_dict = PipelineRunResult.from_dict(pipeline_run_result_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) + + diff --git a/docs/PipelineRunResultList.md b/docs/PipelineRunResultList.md new file mode 100644 index 0000000..050cafc --- /dev/null +++ b/docs/PipelineRunResultList.md @@ -0,0 +1,30 @@ +# PipelineRunResultList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PipelineRunResult]**](PipelineRunResult.md) | | [optional] +**metadata** | [**Metadata**](Metadata.md) | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_run_result_list import PipelineRunResultList + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineRunResultList from a JSON string +pipeline_run_result_list_instance = PipelineRunResultList.from_json(json) +# print the JSON string representation of the object +print(PipelineRunResultList.to_json()) + +# convert the object into a dict +pipeline_run_result_list_dict = pipeline_run_result_list_instance.to_dict() +# create an instance of PipelineRunResultList from a dict +pipeline_run_result_list_from_dict = PipelineRunResultList.from_dict(pipeline_run_result_list_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) + + diff --git a/docs/PipelineRunResultVote.md b/docs/PipelineRunResultVote.md new file mode 100644 index 0000000..38c0591 --- /dev/null +++ b/docs/PipelineRunResultVote.md @@ -0,0 +1,32 @@ +# PipelineRunResultVote + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**pipeline_run_result_id** | **str** | | [optional] +**user_id** | **str** | | [optional] +**vote** | **int** | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineRunResultVote from a JSON string +pipeline_run_result_vote_instance = PipelineRunResultVote.from_json(json) +# print the JSON string representation of the object +print(PipelineRunResultVote.to_json()) + +# convert the object into a dict +pipeline_run_result_vote_dict = pipeline_run_result_vote_instance.to_dict() +# create an instance of PipelineRunResultVote from a dict +pipeline_run_result_vote_from_dict = PipelineRunResultVote.from_dict(pipeline_run_result_vote_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) + + diff --git a/docs/PipelineRunResultVoteList.md b/docs/PipelineRunResultVoteList.md new file mode 100644 index 0000000..6b64b93 --- /dev/null +++ b/docs/PipelineRunResultVoteList.md @@ -0,0 +1,30 @@ +# PipelineRunResultVoteList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**results** | [**List[PipelineRunResultVote]**](PipelineRunResultVote.md) | | [optional] +**metadata** | [**Metadata**](Metadata.md) | | [optional] + +## Example + +```python +from neurostore_sdk.models.pipeline_run_result_vote_list import PipelineRunResultVoteList + +# TODO update the JSON string below +json = "{}" +# create an instance of PipelineRunResultVoteList from a JSON string +pipeline_run_result_vote_list_instance = PipelineRunResultVoteList.from_json(json) +# print the JSON string representation of the object +print(PipelineRunResultVoteList.to_json()) + +# convert the object into a dict +pipeline_run_result_vote_list_dict = pipeline_run_result_vote_list_instance.to_dict() +# create an instance of PipelineRunResultVoteList from a dict +pipeline_run_result_vote_list_from_dict = PipelineRunResultVoteList.from_dict(pipeline_run_result_vote_list_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) + + diff --git a/docs/PipelineRunResultVotesApi.md b/docs/PipelineRunResultVotesApi.md new file mode 100644 index 0000000..c2e09e2 --- /dev/null +++ b/docs/PipelineRunResultVotesApi.md @@ -0,0 +1,334 @@ +# neurostore_sdk.PipelineRunResultVotesApi + +All URIs are relative to *https://neurostore.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pipeline_run_result_votes_get**](PipelineRunResultVotesApi.md#pipeline_run_result_votes_get) | **GET** /pipeline-run-result-votes/ | GET a list of pipeline run result votes +[**pipeline_run_result_votes_pipeline_run_result_vote_id_delete**](PipelineRunResultVotesApi.md#pipeline_run_result_votes_pipeline_run_result_vote_id_delete) | **DELETE** /pipeline-run-result-votes/{pipeline_run_result_vote_id} | DELETE a pipeline run result vote by ID +[**pipeline_run_result_votes_pipeline_run_result_vote_id_get**](PipelineRunResultVotesApi.md#pipeline_run_result_votes_pipeline_run_result_vote_id_get) | **GET** /pipeline-run-result-votes/{pipeline_run_result_vote_id} | GET a pipeline run result vote by ID +[**pipeline_run_result_votes_pipeline_run_result_vote_id_put**](PipelineRunResultVotesApi.md#pipeline_run_result_votes_pipeline_run_result_vote_id_put) | **PUT** /pipeline-run-result-votes/{pipeline_run_result_vote_id} | PUT/update a pipeline run result vote by ID +[**pipeline_run_result_votes_post**](PipelineRunResultVotesApi.md#pipeline_run_result_votes_post) | **POST** /pipeline-run-result-votes/ | POST/create a pipeline run result vote + + +# **pipeline_run_result_votes_get** +> PipelineRunResultVoteList pipeline_run_result_votes_get() + +GET a list of pipeline run result votes + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result_vote_list import PipelineRunResultVoteList +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultVotesApi(api_client) + + try: + # GET a list of pipeline run result votes + api_response = api_instance.pipeline_run_result_votes_get() + print("The response of PipelineRunResultVotesApi->pipeline_run_result_votes_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineRunResultVotesApi->pipeline_run_result_votes_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**PipelineRunResultVoteList**](PipelineRunResultVoteList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_result_votes_pipeline_run_result_vote_id_delete** +> pipeline_run_result_votes_pipeline_run_result_vote_id_delete(pipeline_run_result_vote_id) + +DELETE a pipeline run result vote by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultVotesApi(api_client) + pipeline_run_result_vote_id = 'pipeline_run_result_vote_id_example' # str | + + try: + # DELETE a pipeline run result vote by ID + api_instance.pipeline_run_result_votes_pipeline_run_result_vote_id_delete(pipeline_run_result_vote_id) + except Exception as e: + print("Exception when calling PipelineRunResultVotesApi->pipeline_run_result_votes_pipeline_run_result_vote_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_vote_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_result_votes_pipeline_run_result_vote_id_get** +> PipelineRunResultVote pipeline_run_result_votes_pipeline_run_result_vote_id_get(pipeline_run_result_vote_id) + +GET a pipeline run result vote by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultVotesApi(api_client) + pipeline_run_result_vote_id = 'pipeline_run_result_vote_id_example' # str | + + try: + # GET a pipeline run result vote by ID + api_response = api_instance.pipeline_run_result_votes_pipeline_run_result_vote_id_get(pipeline_run_result_vote_id) + print("The response of PipelineRunResultVotesApi->pipeline_run_result_votes_pipeline_run_result_vote_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineRunResultVotesApi->pipeline_run_result_votes_pipeline_run_result_vote_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_vote_id** | **str**| | + +### Return type + +[**PipelineRunResultVote**](PipelineRunResultVote.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_result_votes_pipeline_run_result_vote_id_put** +> pipeline_run_result_votes_pipeline_run_result_vote_id_put(pipeline_run_result_vote_id, pipeline_run_result_vote=pipeline_run_result_vote) + +PUT/update a pipeline run result vote by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultVotesApi(api_client) + pipeline_run_result_vote_id = 'pipeline_run_result_vote_id_example' # str | + pipeline_run_result_vote = neurostore_sdk.PipelineRunResultVote() # PipelineRunResultVote | (optional) + + try: + # PUT/update a pipeline run result vote by ID + api_instance.pipeline_run_result_votes_pipeline_run_result_vote_id_put(pipeline_run_result_vote_id, pipeline_run_result_vote=pipeline_run_result_vote) + except Exception as e: + print("Exception when calling PipelineRunResultVotesApi->pipeline_run_result_votes_pipeline_run_result_vote_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_vote_id** | **str**| | + **pipeline_run_result_vote** | [**PipelineRunResultVote**](PipelineRunResultVote.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_result_votes_post** +> pipeline_run_result_votes_post(pipeline_run_result_vote=pipeline_run_result_vote) + +POST/create a pipeline run result vote + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultVotesApi(api_client) + pipeline_run_result_vote = neurostore_sdk.PipelineRunResultVote() # PipelineRunResultVote | (optional) + + try: + # POST/create a pipeline run result vote + api_instance.pipeline_run_result_votes_post(pipeline_run_result_vote=pipeline_run_result_vote) + except Exception as e: + print("Exception when calling PipelineRunResultVotesApi->pipeline_run_result_votes_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_vote** | [**PipelineRunResultVote**](PipelineRunResultVote.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/PipelineRunResultsApi.md b/docs/PipelineRunResultsApi.md new file mode 100644 index 0000000..1b040eb --- /dev/null +++ b/docs/PipelineRunResultsApi.md @@ -0,0 +1,334 @@ +# neurostore_sdk.PipelineRunResultsApi + +All URIs are relative to *https://neurostore.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pipeline_run_results_get**](PipelineRunResultsApi.md#pipeline_run_results_get) | **GET** /pipeline-run-results/ | GET a list of pipeline run results +[**pipeline_run_results_pipeline_run_result_id_delete**](PipelineRunResultsApi.md#pipeline_run_results_pipeline_run_result_id_delete) | **DELETE** /pipeline-run-results/{pipeline_run_result_id} | DELETE a pipeline run result by ID +[**pipeline_run_results_pipeline_run_result_id_get**](PipelineRunResultsApi.md#pipeline_run_results_pipeline_run_result_id_get) | **GET** /pipeline-run-results/{pipeline_run_result_id} | GET a pipeline run result by ID +[**pipeline_run_results_pipeline_run_result_id_put**](PipelineRunResultsApi.md#pipeline_run_results_pipeline_run_result_id_put) | **PUT** /pipeline-run-results/{pipeline_run_result_id} | PUT/update a pipeline run result by ID +[**pipeline_run_results_post**](PipelineRunResultsApi.md#pipeline_run_results_post) | **POST** /pipeline-run-results/ | POST/create a pipeline run result + + +# **pipeline_run_results_get** +> PipelineRunResultList pipeline_run_results_get() + +GET a list of pipeline run results + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result_list import PipelineRunResultList +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultsApi(api_client) + + try: + # GET a list of pipeline run results + api_response = api_instance.pipeline_run_results_get() + print("The response of PipelineRunResultsApi->pipeline_run_results_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineRunResultsApi->pipeline_run_results_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**PipelineRunResultList**](PipelineRunResultList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_results_pipeline_run_result_id_delete** +> pipeline_run_results_pipeline_run_result_id_delete(pipeline_run_result_id) + +DELETE a pipeline run result by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultsApi(api_client) + pipeline_run_result_id = 'pipeline_run_result_id_example' # str | + + try: + # DELETE a pipeline run result by ID + api_instance.pipeline_run_results_pipeline_run_result_id_delete(pipeline_run_result_id) + except Exception as e: + print("Exception when calling PipelineRunResultsApi->pipeline_run_results_pipeline_run_result_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_results_pipeline_run_result_id_get** +> PipelineRunResult pipeline_run_results_pipeline_run_result_id_get(pipeline_run_result_id) + +GET a pipeline run result by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultsApi(api_client) + pipeline_run_result_id = 'pipeline_run_result_id_example' # str | + + try: + # GET a pipeline run result by ID + api_response = api_instance.pipeline_run_results_pipeline_run_result_id_get(pipeline_run_result_id) + print("The response of PipelineRunResultsApi->pipeline_run_results_pipeline_run_result_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineRunResultsApi->pipeline_run_results_pipeline_run_result_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_id** | **str**| | + +### Return type + +[**PipelineRunResult**](PipelineRunResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_results_pipeline_run_result_id_put** +> pipeline_run_results_pipeline_run_result_id_put(pipeline_run_result_id, pipeline_run_result=pipeline_run_result) + +PUT/update a pipeline run result by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultsApi(api_client) + pipeline_run_result_id = 'pipeline_run_result_id_example' # str | + pipeline_run_result = neurostore_sdk.PipelineRunResult() # PipelineRunResult | (optional) + + try: + # PUT/update a pipeline run result by ID + api_instance.pipeline_run_results_pipeline_run_result_id_put(pipeline_run_result_id, pipeline_run_result=pipeline_run_result) + except Exception as e: + print("Exception when calling PipelineRunResultsApi->pipeline_run_results_pipeline_run_result_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result_id** | **str**| | + **pipeline_run_result** | [**PipelineRunResult**](PipelineRunResult.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_run_results_post** +> pipeline_run_results_post(pipeline_run_result=pipeline_run_result) + +POST/create a pipeline run result + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunResultsApi(api_client) + pipeline_run_result = neurostore_sdk.PipelineRunResult() # PipelineRunResult | (optional) + + try: + # POST/create a pipeline run result + api_instance.pipeline_run_results_post(pipeline_run_result=pipeline_run_result) + except Exception as e: + print("Exception when calling PipelineRunResultsApi->pipeline_run_results_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_result** | [**PipelineRunResult**](PipelineRunResult.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/PipelineRunsApi.md b/docs/PipelineRunsApi.md new file mode 100644 index 0000000..375cb7b --- /dev/null +++ b/docs/PipelineRunsApi.md @@ -0,0 +1,334 @@ +# neurostore_sdk.PipelineRunsApi + +All URIs are relative to *https://neurostore.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pipeline_runs_get**](PipelineRunsApi.md#pipeline_runs_get) | **GET** /pipeline-runs/ | GET a list of pipeline runs +[**pipeline_runs_pipeline_run_id_delete**](PipelineRunsApi.md#pipeline_runs_pipeline_run_id_delete) | **DELETE** /pipeline-runs/{pipeline_run_id} | DELETE a pipeline run by ID +[**pipeline_runs_pipeline_run_id_get**](PipelineRunsApi.md#pipeline_runs_pipeline_run_id_get) | **GET** /pipeline-runs/{pipeline_run_id} | GET a pipeline run by ID +[**pipeline_runs_pipeline_run_id_put**](PipelineRunsApi.md#pipeline_runs_pipeline_run_id_put) | **PUT** /pipeline-runs/{pipeline_run_id} | PUT/update a pipeline run by ID +[**pipeline_runs_post**](PipelineRunsApi.md#pipeline_runs_post) | **POST** /pipeline-runs/ | POST/create a pipeline run + + +# **pipeline_runs_get** +> PipelineRunList pipeline_runs_get() + +GET a list of pipeline runs + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run_list import PipelineRunList +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunsApi(api_client) + + try: + # GET a list of pipeline runs + api_response = api_instance.pipeline_runs_get() + print("The response of PipelineRunsApi->pipeline_runs_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineRunsApi->pipeline_runs_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**PipelineRunList**](PipelineRunList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_runs_pipeline_run_id_delete** +> pipeline_runs_pipeline_run_id_delete(pipeline_run_id) + +DELETE a pipeline run by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunsApi(api_client) + pipeline_run_id = 'pipeline_run_id_example' # str | + + try: + # DELETE a pipeline run by ID + api_instance.pipeline_runs_pipeline_run_id_delete(pipeline_run_id) + except Exception as e: + print("Exception when calling PipelineRunsApi->pipeline_runs_pipeline_run_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_runs_pipeline_run_id_get** +> PipelineRun pipeline_runs_pipeline_run_id_get(pipeline_run_id) + +GET a pipeline run by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run import PipelineRun +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunsApi(api_client) + pipeline_run_id = 'pipeline_run_id_example' # str | + + try: + # GET a pipeline run by ID + api_response = api_instance.pipeline_runs_pipeline_run_id_get(pipeline_run_id) + print("The response of PipelineRunsApi->pipeline_runs_pipeline_run_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelineRunsApi->pipeline_runs_pipeline_run_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_id** | **str**| | + +### Return type + +[**PipelineRun**](PipelineRun.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_runs_pipeline_run_id_put** +> pipeline_runs_pipeline_run_id_put(pipeline_run_id, pipeline_run=pipeline_run) + +PUT/update a pipeline run by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run import PipelineRun +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunsApi(api_client) + pipeline_run_id = 'pipeline_run_id_example' # str | + pipeline_run = neurostore_sdk.PipelineRun() # PipelineRun | (optional) + + try: + # PUT/update a pipeline run by ID + api_instance.pipeline_runs_pipeline_run_id_put(pipeline_run_id, pipeline_run=pipeline_run) + except Exception as e: + print("Exception when calling PipelineRunsApi->pipeline_runs_pipeline_run_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run_id** | **str**| | + **pipeline_run** | [**PipelineRun**](PipelineRun.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipeline_runs_post** +> pipeline_runs_post(pipeline_run=pipeline_run) + +POST/create a pipeline run + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_run import PipelineRun +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelineRunsApi(api_client) + pipeline_run = neurostore_sdk.PipelineRun() # PipelineRun | (optional) + + try: + # POST/create a pipeline run + api_instance.pipeline_runs_post(pipeline_run=pipeline_run) + except Exception as e: + print("Exception when calling PipelineRunsApi->pipeline_runs_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline_run** | [**PipelineRun**](PipelineRun.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/PipelinesApi.md b/docs/PipelinesApi.md new file mode 100644 index 0000000..e935a1a --- /dev/null +++ b/docs/PipelinesApi.md @@ -0,0 +1,334 @@ +# neurostore_sdk.PipelinesApi + +All URIs are relative to *https://neurostore.org/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**pipelines_get**](PipelinesApi.md#pipelines_get) | **GET** /pipelines/ | GET a list of pipelines +[**pipelines_id_delete**](PipelinesApi.md#pipelines_id_delete) | **DELETE** /pipelines/{id} | DELETE a pipeline by ID +[**pipelines_id_get**](PipelinesApi.md#pipelines_id_get) | **GET** /pipelines/{id} | GET a pipeline by ID +[**pipelines_id_put**](PipelinesApi.md#pipelines_id_put) | **PUT** /pipelines/{id} | PUT/update a pipeline by ID +[**pipelines_post**](PipelinesApi.md#pipelines_post) | **POST** /pipelines/ | POST/create a pipeline + + +# **pipelines_get** +> PipelineList pipelines_get() + +GET a list of pipelines + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline_list import PipelineList +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelinesApi(api_client) + + try: + # GET a list of pipelines + api_response = api_instance.pipelines_get() + print("The response of PipelinesApi->pipelines_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelinesApi->pipelines_get: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**PipelineList**](PipelineList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipelines_id_delete** +> pipelines_id_delete(id) + +DELETE a pipeline by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelinesApi(api_client) + id = 'id_example' # str | + + try: + # DELETE a pipeline by ID + api_instance.pipelines_id_delete(id) + except Exception as e: + print("Exception when calling PipelinesApi->pipelines_id_delete: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipelines_id_get** +> Pipeline pipelines_id_get(id) + +GET a pipeline by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline import Pipeline +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelinesApi(api_client) + id = 'id_example' # str | + + try: + # GET a pipeline by ID + api_response = api_instance.pipelines_id_get(id) + print("The response of PipelinesApi->pipelines_id_get:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PipelinesApi->pipelines_id_get: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + +### Return type + +[**Pipeline**](Pipeline.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipelines_id_put** +> pipelines_id_put(id, pipeline=pipeline) + +PUT/update a pipeline by ID + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline import Pipeline +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelinesApi(api_client) + id = 'id_example' # str | + pipeline = neurostore_sdk.Pipeline() # Pipeline | (optional) + + try: + # PUT/update a pipeline by ID + api_instance.pipelines_id_put(id, pipeline=pipeline) + except Exception as e: + print("Exception when calling PipelinesApi->pipelines_id_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| | + **pipeline** | [**Pipeline**](Pipeline.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **pipelines_post** +> pipelines_post(pipeline=pipeline) + +POST/create a pipeline + +### Example + + +```python +import neurostore_sdk +from neurostore_sdk.models.pipeline import Pipeline +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.PipelinesApi(api_client) + pipeline = neurostore_sdk.Pipeline() # Pipeline | (optional) + + try: + # POST/create a pipeline + api_instance.pipelines_post(pipeline=pipeline) + except Exception as e: + print("Exception when calling PipelinesApi->pipelines_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipeline** | [**Pipeline**](Pipeline.md)| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/PointBase.md b/docs/PointBase.md index 1c530c6..e78bb26 100644 --- a/docs/PointBase.md +++ b/docs/PointBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **coordinates** | **List[float]** | Location of the significant coordinate in three dimensional space. | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PointBase from a JSON string point_base_instance = PointBase.from_json(json) # print the JSON string representation of the object -print PointBase.to_json() +print(PointBase.to_json()) # convert the object into a dict point_base_dict = point_base_instance.to_dict() # create an instance of PointBase from a dict -point_base_form_dict = point_base.from_dict(point_base_dict) +point_base_from_dict = PointBase.from_dict(point_base_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) diff --git a/docs/PointCommon.md b/docs/PointCommon.md index 1743b8b..aa1e76e 100644 --- a/docs/PointCommon.md +++ b/docs/PointCommon.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **analysis** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PointCommon from a JSON string point_common_instance = PointCommon.from_json(json) # print the JSON string representation of the object -print PointCommon.to_json() +print(PointCommon.to_json()) # convert the object into a dict point_common_dict = point_common_instance.to_dict() # create an instance of PointCommon from a dict -point_common_form_dict = point_common.from_dict(point_common_dict) +point_common_from_dict = PointCommon.from_dict(point_common_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) diff --git a/docs/PointList.md b/docs/PointList.md index 55fa146..6c5b86d 100644 --- a/docs/PointList.md +++ b/docs/PointList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[PointReturn]**](PointReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of PointList from a JSON string point_list_instance = PointList.from_json(json) # print the JSON string representation of the object -print PointList.to_json() +print(PointList.to_json()) # convert the object into a dict point_list_dict = point_list_instance.to_dict() # create an instance of PointList from a dict -point_list_form_dict = point_list.from_dict(point_list_dict) +point_list_from_dict = PointList.from_dict(point_list_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) diff --git a/docs/PointRelationships.md b/docs/PointRelationships.md index f12acc8..2d7c638 100644 --- a/docs/PointRelationships.md +++ b/docs/PointRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **image** | **str** | | [optional] @@ -21,12 +22,12 @@ json = "{}" # create an instance of PointRelationships from a JSON string point_relationships_instance = PointRelationships.from_json(json) # print the JSON string representation of the object -print PointRelationships.to_json() +print(PointRelationships.to_json()) # convert the object into a dict point_relationships_dict = point_relationships_instance.to_dict() # create an instance of PointRelationships from a dict -point_relationships_form_dict = point_relationships.from_dict(point_relationships_dict) +point_relationships_from_dict = PointRelationships.from_dict(point_relationships_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) diff --git a/docs/PointRelationshipsValue.md b/docs/PointRelationshipsValue.md deleted file mode 100644 index 19339f6..0000000 --- a/docs/PointRelationshipsValue.md +++ /dev/null @@ -1,29 +0,0 @@ -# PointRelationshipsValue - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kind** | **str** | | [optional] -**value** | **float** | | [optional] - -## Example - -```python -from neurostore_sdk.models.point_relationships_value import PointRelationshipsValue - -# TODO update the JSON string below -json = "{}" -# create an instance of PointRelationshipsValue from a JSON string -point_relationships_value_instance = PointRelationshipsValue.from_json(json) -# print the JSON string representation of the object -print PointRelationshipsValue.to_json() - -# convert the object into a dict -point_relationships_value_dict = point_relationships_value_instance.to_dict() -# create an instance of PointRelationshipsValue from a dict -point_relationships_value_form_dict = point_relationships_value.from_dict(point_relationships_value_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) - - diff --git a/docs/PointRelationshipsValues.md b/docs/PointRelationshipsValues.md index 6af2f86..cd6ddd9 100644 --- a/docs/PointRelationshipsValues.md +++ b/docs/PointRelationshipsValues.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of PointRelationshipsValues from a JSON string point_relationships_values_instance = PointRelationshipsValues.from_json(json) # print the JSON string representation of the object -print PointRelationshipsValues.to_json() +print(PointRelationshipsValues.to_json()) # convert the object into a dict point_relationships_values_dict = point_relationships_values_instance.to_dict() # create an instance of PointRelationshipsValues from a dict -point_relationships_values_form_dict = point_relationships_values.from_dict(point_relationships_values_dict) +point_relationships_values_from_dict = PointRelationshipsValues.from_dict(point_relationships_values_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) diff --git a/docs/PointRequest.md b/docs/PointRequest.md index 56c6e8f..ca5fcbe 100644 --- a/docs/PointRequest.md +++ b/docs/PointRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **coordinates** | **List[float]** | Location of the significant coordinate in three dimensional space. | [optional] @@ -31,12 +32,12 @@ json = "{}" # create an instance of PointRequest from a JSON string point_request_instance = PointRequest.from_json(json) # print the JSON string representation of the object -print PointRequest.to_json() +print(PointRequest.to_json()) # convert the object into a dict point_request_dict = point_request_instance.to_dict() # create an instance of PointRequest from a dict -point_request_form_dict = point_request.from_dict(point_request_dict) +point_request_from_dict = PointRequest.from_dict(point_request_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) diff --git a/docs/PointReturn.md b/docs/PointReturn.md index c215bec..b1a0c09 100644 --- a/docs/PointReturn.md +++ b/docs/PointReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **coordinates** | **List[float]** | Location of the significant coordinate in three dimensional space. | [optional] @@ -35,12 +36,12 @@ json = "{}" # create an instance of PointReturn from a JSON string point_return_instance = PointReturn.from_json(json) # print the JSON string representation of the object -print PointReturn.to_json() +print(PointReturn.to_json()) # convert the object into a dict point_return_dict = point_return_instance.to_dict() # create an instance of PointReturn from a dict -point_return_form_dict = point_return.from_dict(point_return_dict) +point_return_from_dict = PointReturn.from_dict(point_return_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) diff --git a/docs/PointValue.md b/docs/PointValue.md index 4b41f4f..073e84c 100644 --- a/docs/PointValue.md +++ b/docs/PointValue.md @@ -3,6 +3,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **kind** | **str** | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of PointValue from a JSON string point_value_instance = PointValue.from_json(json) # print the JSON string representation of the object -print PointValue.to_json() +print(PointValue.to_json()) # convert the object into a dict point_value_dict = point_value_instance.to_dict() # create an instance of PointValue from a dict -point_value_form_dict = point_value.from_dict(point_value_dict) +point_value_from_dict = PointValue.from_dict(point_value_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) diff --git a/docs/PointsApi.md b/docs/PointsApi.md index d074ff8..89ee15d 100644 --- a/docs/PointsApi.md +++ b/docs/PointsApi.md @@ -20,9 +20,8 @@ list points in database ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_list import PointList from neurostore_sdk.rest import ApiException @@ -50,7 +49,9 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -67,6 +68,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -83,9 +85,8 @@ delete a point ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -120,8 +121,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -140,6 +143,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -155,9 +159,8 @@ Information about a particular MRI coordinate ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_return import PointReturn from neurostore_sdk.rest import ApiException @@ -186,8 +189,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -206,6 +211,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -223,9 +229,8 @@ Update a particular MRI coordinate. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn @@ -265,8 +270,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -286,6 +293,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -303,9 +311,8 @@ add a point to an analysis ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn @@ -344,8 +351,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **point_request** | [**PointRequest**](PointRequest.md)| | [optional] @@ -364,6 +373,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/ReadableResourceAttributes.md b/docs/ReadableResourceAttributes.md deleted file mode 100644 index 780de97..0000000 --- a/docs/ReadableResourceAttributes.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReadableResourceAttributes - -common readable resource attributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] -**updated_at** | **str** | when the resource was last modified/updated. | [optional] [readonly] - -## Example - -```python -from neurostore_sdk.models.readable_resource_attributes import ReadableResourceAttributes - -# TODO update the JSON string below -json = "{}" -# create an instance of ReadableResourceAttributes from a JSON string -readable_resource_attributes_instance = ReadableResourceAttributes.from_json(json) -# print the JSON string representation of the object -print ReadableResourceAttributes.to_json() - -# convert the object into a dict -readable_resource_attributes_dict = readable_resource_attributes_instance.to_dict() -# create an instance of ReadableResourceAttributes from a dict -readable_resource_attributes_form_dict = readable_resource_attributes.from_dict(readable_resource_attributes_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) - - diff --git a/docs/ResourceAttributes.md b/docs/ResourceAttributes.md index 7fa053c..cc585ab 100644 --- a/docs/ResourceAttributes.md +++ b/docs/ResourceAttributes.md @@ -3,6 +3,7 @@ common attributes for user owned resources ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] @@ -22,12 +23,12 @@ json = "{}" # create an instance of ResourceAttributes from a JSON string resource_attributes_instance = ResourceAttributes.from_json(json) # print the JSON string representation of the object -print ResourceAttributes.to_json() +print(ResourceAttributes.to_json()) # convert the object into a dict resource_attributes_dict = resource_attributes_instance.to_dict() # create an instance of ResourceAttributes from a dict -resource_attributes_form_dict = resource_attributes.from_dict(resource_attributes_dict) +resource_attributes_from_dict = ResourceAttributes.from_dict(resource_attributes_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) diff --git a/docs/StoreApi.md b/docs/StoreApi.md index c4e9317..6fc105e 100644 --- a/docs/StoreApi.md +++ b/docs/StoreApi.md @@ -57,9 +57,8 @@ List all analyses performed across studies. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_list import AnalysisList from neurostore_sdk.rest import ApiException @@ -95,8 +94,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -122,6 +123,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -138,9 +140,8 @@ delete an analysis ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -175,8 +176,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -195,6 +198,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -210,9 +214,8 @@ Information pertaining to a particular analysis within a study. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_return import AnalysisReturn from neurostore_sdk.rest import ApiException @@ -242,8 +245,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -263,6 +268,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -280,9 +286,8 @@ Update an existing analysis. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_request import AnalysisRequest from neurostore_sdk.models.analysis_return import AnalysisReturn @@ -322,8 +327,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -343,6 +350,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -360,9 +368,8 @@ create an analysis ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.analysis_request import AnalysisRequest from neurostore_sdk.models.analysis_return import AnalysisReturn @@ -401,8 +408,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **analysis_request** | [**AnalysisRequest**](AnalysisRequest.md)| | [optional] @@ -421,6 +430,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -434,9 +444,8 @@ Get annotation analyses ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_list import NoteCollectionList from neurostore_sdk.rest import ApiException @@ -464,7 +473,9 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -481,6 +492,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -496,9 +508,8 @@ Your GET endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_return import NoteCollectionReturn from neurostore_sdk.rest import ApiException @@ -536,8 +547,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -556,6 +569,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -570,9 +584,8 @@ Your PUT endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn @@ -612,8 +625,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -633,6 +648,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -649,9 +665,8 @@ This endpoint does not allow for creation, only modification of existing annotat ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn @@ -690,8 +705,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **note_collection_request** | [**List[NoteCollectionRequest]**](NoteCollectionRequest.md)| | [optional] @@ -710,6 +727,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -725,9 +743,8 @@ get annotations for an available studyset ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_list import AnnotationList from neurostore_sdk.rest import ApiException @@ -756,8 +773,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_id** | **str**| see all annotations connected to this studyset | [optional] @@ -776,6 +795,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -792,9 +812,8 @@ delete annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -829,8 +848,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -849,6 +870,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -864,9 +886,8 @@ get an individual annotation ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_return import AnnotationReturn from neurostore_sdk.rest import ApiException @@ -896,8 +917,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -917,6 +940,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -933,9 +957,8 @@ edit an existing annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_request import AnnotationRequest from neurostore_sdk.models.annotation_return import AnnotationReturn @@ -975,8 +998,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -996,6 +1021,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1012,9 +1038,8 @@ Create an annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.annotation_request import AnnotationRequest from neurostore_sdk.models.annotation_return import AnnotationReturn @@ -1041,7 +1066,7 @@ configuration = neurostore_sdk.Configuration( with neurostore_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurostore_sdk.StoreApi(api_client) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) annotation_request = neurostore_sdk.AnnotationRequest() # AnnotationRequest | (optional) @@ -1055,11 +1080,13 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **annotation_request** | [**AnnotationRequest**](AnnotationRequest.md)| | [optional] @@ -1077,6 +1104,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1091,9 +1119,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_study_list import BaseStudyList from neurostore_sdk.rest import ApiException @@ -1127,7 +1154,7 @@ with neurostore_sdk.ApiClient(configuration) as api_client: name = 'name_example' # str | search the name field for a term (optional) description = 'description_example' # str | search description field for a term (optional) authors = 'authors_example' # str | search authors (optional) - level = 'group' # str | select between studies with group results or meta results (optional) (default to 'group') + level = group # str | select between studies with group results or meta results (optional) (default to group) data_type = 'data_type_example' # str | whether searching for studies that contain coordinates, images, or both (optional) publication = 'publication_example' # str | search for papers from a particular journal (optional) pmid = 'pmid_example' # str | search for particular pmid (optional) @@ -1145,8 +1172,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -1157,7 +1186,7 @@ Name | Type | Description | Notes **name** | **str**| search the name field for a term | [optional] **description** | **str**| search description field for a term | [optional] **authors** | **str**| search authors | [optional] - **level** | **str**| select between studies with group results or meta results | [optional] [default to 'group'] + **level** | **str**| select between studies with group results or meta results | [optional] [default to group] **data_type** | **str**| whether searching for studies that contain coordinates, images, or both | [optional] **publication** | **str**| search for papers from a particular journal | [optional] **pmid** | **str**| search for particular pmid | [optional] @@ -1179,6 +1208,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1192,9 +1222,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_study_return import BaseStudyReturn from neurostore_sdk.rest import ApiException @@ -1225,8 +1254,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1247,6 +1278,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1261,9 +1293,8 @@ No authorization required ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_study import BaseStudy from neurostore_sdk.models.base_study_return import BaseStudyReturn @@ -1303,8 +1334,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1324,6 +1357,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1338,9 +1372,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_studies_post200_response import BaseStudiesPost200Response from neurostore_sdk.models.base_studies_post_request import BaseStudiesPostRequest @@ -1379,8 +1412,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **base_studies_post_request** | [**BaseStudiesPostRequest**](BaseStudiesPostRequest.md)| | [optional] @@ -1399,6 +1434,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1414,9 +1450,8 @@ Get all conditions ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_list import ConditionList from neurostore_sdk.rest import ApiException @@ -1451,8 +1486,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -1477,6 +1514,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1493,9 +1531,8 @@ delete a condition ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -1530,8 +1567,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1550,6 +1589,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1565,9 +1605,8 @@ Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_return import ConditionReturn from neurostore_sdk.rest import ApiException @@ -1596,8 +1635,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1616,6 +1657,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1633,9 +1675,8 @@ update a condition ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_request import ConditionRequest from neurostore_sdk.models.condition_return import ConditionReturn @@ -1675,8 +1716,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1696,6 +1739,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1713,9 +1757,8 @@ Create a condition ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.condition_request import ConditionRequest from neurostore_sdk.models.condition_return import ConditionReturn @@ -1754,8 +1797,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **condition_request** | [**ConditionRequest**](ConditionRequest.md)| | [optional] @@ -1774,6 +1819,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1789,9 +1835,8 @@ Retrieve and list images. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_list import ImageList from neurostore_sdk.rest import ApiException @@ -1828,8 +1873,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -1856,6 +1903,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1872,9 +1920,8 @@ delete an image ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -1909,8 +1956,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1929,6 +1978,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1944,9 +1994,8 @@ Retrieve information about a particular image from an analysis. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_return import ImageReturn from neurostore_sdk.rest import ApiException @@ -1975,8 +2024,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1995,6 +2046,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2012,9 +2064,8 @@ Update a specific image. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn @@ -2054,8 +2105,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2075,6 +2128,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2092,9 +2146,8 @@ Create an image ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn @@ -2133,8 +2186,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **image_request** | [**ImageRequest**](ImageRequest.md)| | [optional] @@ -2153,6 +2208,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2168,9 +2224,8 @@ list points in database ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_list import PointList from neurostore_sdk.rest import ApiException @@ -2198,7 +2253,9 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -2215,6 +2272,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2231,9 +2289,8 @@ delete a point ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -2268,8 +2325,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2288,6 +2347,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2303,9 +2363,8 @@ Information about a particular MRI coordinate ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_return import PointReturn from neurostore_sdk.rest import ApiException @@ -2334,8 +2393,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2354,6 +2415,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2371,9 +2433,8 @@ Update a particular MRI coordinate. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn @@ -2413,8 +2474,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2434,6 +2497,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2451,9 +2515,8 @@ add a point to an analysis ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn @@ -2492,8 +2555,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **point_request** | [**PointRequest**](PointRequest.md)| | [optional] @@ -2512,6 +2577,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2528,9 +2594,8 @@ List studies ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_list import StudyList from neurostore_sdk.rest import ApiException @@ -2566,12 +2631,12 @@ with neurostore_sdk.ApiClient(configuration) as api_client: description = 'description_example' # str | search description field for a term (optional) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) unique = None # object | whether to list clones with originals (optional) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) authors = 'authors_example' # str | search authors (optional) user_id = 'user_id_example' # str | user id you want to filter by (optional) data_type = 'data_type_example' # str | whether searching for studies that contain coordinates, images, or both (optional) studyset_owner = 'studyset_owner_example' # str | for all studies filter which studysets are listed based on who owns the studyset (optional) - level = 'group' # str | select between studies with group results or meta results (optional) (default to 'group') + level = group # str | select between studies with group results or meta results (optional) (default to group) pmid = 'pmid_example' # str | search for particular pmid (optional) doi = 'doi_example' # str | search for study with specific doi (optional) flat = True # bool | do not return any embedded relationships. When set, it is incompatible with nested. (optional) @@ -2586,8 +2651,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -2600,12 +2667,12 @@ Name | Type | Description | Notes **description** | **str**| search description field for a term | [optional] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **unique** | [**object**](.md)| whether to list clones with originals | [optional] - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **authors** | **str**| search authors | [optional] **user_id** | **str**| user id you want to filter by | [optional] **data_type** | **str**| whether searching for studies that contain coordinates, images, or both | [optional] **studyset_owner** | **str**| for all studies filter which studysets are listed based on who owns the studyset | [optional] - **level** | **str**| select between studies with group results or meta results | [optional] [default to 'group'] + **level** | **str**| select between studies with group results or meta results | [optional] [default to group] **pmid** | **str**| search for particular pmid | [optional] **doi** | **str**| search for study with specific doi | [optional] **flat** | **bool**| do not return any embedded relationships. When set, it is incompatible with nested. | [optional] @@ -2624,6 +2691,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2640,9 +2708,8 @@ delete a study ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -2677,8 +2744,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2697,6 +2766,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2712,9 +2782,8 @@ Get a study. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_return import StudyReturn from neurostore_sdk.rest import ApiException @@ -2746,8 +2815,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2769,6 +2840,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Study Found | - | @@ -2786,9 +2858,8 @@ Update a study. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_request import StudyRequest from neurostore_sdk.models.study_return import StudyReturn @@ -2828,8 +2899,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2849,6 +2922,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2866,9 +2940,8 @@ Create a study ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_request import StudyRequest from neurostore_sdk.models.study_return import StudyReturn @@ -2895,7 +2968,7 @@ configuration = neurostore_sdk.Configuration( with neurostore_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurostore_sdk.StoreApi(api_client) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) study_request = neurostore_sdk.StudyRequest() # StudyRequest | (optional) @@ -2909,11 +2982,13 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **study_request** | [**StudyRequest**](StudyRequest.md)| | [optional] @@ -2931,6 +3006,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2947,9 +3023,8 @@ delete a studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -2984,8 +3059,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -3004,6 +3081,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -3019,9 +3097,8 @@ Retrieve the information of a studyset with the matching studyset ID. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_return import StudysetReturn from neurostore_sdk.rest import ApiException @@ -3052,8 +3129,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -3074,6 +3153,7 @@ No authorization required - **Accept**: application/json, application/gzip ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | studyset found | - | @@ -3091,9 +3171,8 @@ Update a studyset. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_request import StudysetRequest from neurostore_sdk.models.studyset_return import StudysetReturn @@ -3133,8 +3212,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -3154,6 +3235,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -3171,9 +3253,8 @@ Create a studyset. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_request import StudysetRequest from neurostore_sdk.models.studyset_return import StudysetReturn @@ -3212,8 +3293,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_request** | [**StudysetRequest**](StudysetRequest.md)| | [optional] @@ -3232,6 +3315,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/StudiesApi.md b/docs/StudiesApi.md index 5d910ce..186d4a6 100644 --- a/docs/StudiesApi.md +++ b/docs/StudiesApi.md @@ -23,9 +23,8 @@ Method | HTTP request | Description ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_study_list import BaseStudyList from neurostore_sdk.rest import ApiException @@ -59,7 +58,7 @@ with neurostore_sdk.ApiClient(configuration) as api_client: name = 'name_example' # str | search the name field for a term (optional) description = 'description_example' # str | search description field for a term (optional) authors = 'authors_example' # str | search authors (optional) - level = 'group' # str | select between studies with group results or meta results (optional) (default to 'group') + level = group # str | select between studies with group results or meta results (optional) (default to group) data_type = 'data_type_example' # str | whether searching for studies that contain coordinates, images, or both (optional) publication = 'publication_example' # str | search for papers from a particular journal (optional) pmid = 'pmid_example' # str | search for particular pmid (optional) @@ -77,8 +76,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -89,7 +90,7 @@ Name | Type | Description | Notes **name** | **str**| search the name field for a term | [optional] **description** | **str**| search description field for a term | [optional] **authors** | **str**| search authors | [optional] - **level** | **str**| select between studies with group results or meta results | [optional] [default to 'group'] + **level** | **str**| select between studies with group results or meta results | [optional] [default to group] **data_type** | **str**| whether searching for studies that contain coordinates, images, or both | [optional] **publication** | **str**| search for papers from a particular journal | [optional] **pmid** | **str**| search for particular pmid | [optional] @@ -111,6 +112,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -124,9 +126,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_study_return import BaseStudyReturn from neurostore_sdk.rest import ApiException @@ -157,8 +158,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -179,6 +182,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -193,9 +197,8 @@ No authorization required ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_study import BaseStudy from neurostore_sdk.models.base_study_return import BaseStudyReturn @@ -235,8 +238,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -256,6 +261,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -270,9 +276,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.base_studies_post200_response import BaseStudiesPost200Response from neurostore_sdk.models.base_studies_post_request import BaseStudiesPostRequest @@ -311,8 +316,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **base_studies_post_request** | [**BaseStudiesPostRequest**](BaseStudiesPostRequest.md)| | [optional] @@ -331,6 +338,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -347,9 +355,8 @@ List studies ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_list import StudyList from neurostore_sdk.rest import ApiException @@ -385,12 +392,12 @@ with neurostore_sdk.ApiClient(configuration) as api_client: description = 'description_example' # str | search description field for a term (optional) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) unique = None # object | whether to list clones with originals (optional) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) authors = 'authors_example' # str | search authors (optional) user_id = 'user_id_example' # str | user id you want to filter by (optional) data_type = 'data_type_example' # str | whether searching for studies that contain coordinates, images, or both (optional) studyset_owner = 'studyset_owner_example' # str | for all studies filter which studysets are listed based on who owns the studyset (optional) - level = 'group' # str | select between studies with group results or meta results (optional) (default to 'group') + level = group # str | select between studies with group results or meta results (optional) (default to group) pmid = 'pmid_example' # str | search for particular pmid (optional) doi = 'doi_example' # str | search for study with specific doi (optional) flat = True # bool | do not return any embedded relationships. When set, it is incompatible with nested. (optional) @@ -405,8 +412,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -419,12 +428,12 @@ Name | Type | Description | Notes **description** | **str**| search description field for a term | [optional] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **unique** | [**object**](.md)| whether to list clones with originals | [optional] - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **authors** | **str**| search authors | [optional] **user_id** | **str**| user id you want to filter by | [optional] **data_type** | **str**| whether searching for studies that contain coordinates, images, or both | [optional] **studyset_owner** | **str**| for all studies filter which studysets are listed based on who owns the studyset | [optional] - **level** | **str**| select between studies with group results or meta results | [optional] [default to 'group'] + **level** | **str**| select between studies with group results or meta results | [optional] [default to group] **pmid** | **str**| search for particular pmid | [optional] **doi** | **str**| search for study with specific doi | [optional] **flat** | **bool**| do not return any embedded relationships. When set, it is incompatible with nested. | [optional] @@ -443,6 +452,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -459,9 +469,8 @@ delete a study ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -496,8 +505,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -516,6 +527,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -531,9 +543,8 @@ Get a study. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_return import StudyReturn from neurostore_sdk.rest import ApiException @@ -565,8 +576,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -588,6 +601,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Study Found | - | @@ -605,9 +619,8 @@ Update a study. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_request import StudyRequest from neurostore_sdk.models.study_return import StudyReturn @@ -647,8 +660,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -668,6 +683,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -685,9 +701,8 @@ Create a study ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.study_request import StudyRequest from neurostore_sdk.models.study_return import StudyReturn @@ -714,7 +729,7 @@ configuration = neurostore_sdk.Configuration( with neurostore_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurostore_sdk.StudiesApi(api_client) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) study_request = neurostore_sdk.StudyRequest() # StudyRequest | (optional) @@ -728,11 +743,13 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **study_request** | [**StudyRequest**](StudyRequest.md)| | [optional] @@ -750,6 +767,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/StudyBase.md b/docs/StudyBase.md index f5732fb..e29a789 100644 --- a/docs/StudyBase.md +++ b/docs/StudyBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **doi** | **str** | Digital object identifier of the study. | [optional] @@ -23,12 +24,12 @@ json = "{}" # create an instance of StudyBase from a JSON string study_base_instance = StudyBase.from_json(json) # print the JSON string representation of the object -print StudyBase.to_json() +print(StudyBase.to_json()) # convert the object into a dict study_base_dict = study_base_instance.to_dict() # create an instance of StudyBase from a dict -study_base_form_dict = study_base.from_dict(study_base_dict) +study_base_from_dict = StudyBase.from_dict(study_base_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) diff --git a/docs/StudyCommon.md b/docs/StudyCommon.md index 32ea8e3..3f201a0 100644 --- a/docs/StudyCommon.md +++ b/docs/StudyCommon.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **level** | **str** | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of StudyCommon from a JSON string study_common_instance = StudyCommon.from_json(json) # print the JSON string representation of the object -print StudyCommon.to_json() +print(StudyCommon.to_json()) # convert the object into a dict study_common_dict = study_common_instance.to_dict() # create an instance of StudyCommon from a dict -study_common_form_dict = study_common.from_dict(study_common_dict) +study_common_from_dict = StudyCommon.from_dict(study_common_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) diff --git a/docs/StudyList.md b/docs/StudyList.md index 72637f3..998534c 100644 --- a/docs/StudyList.md +++ b/docs/StudyList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[StudyReturn]**](StudyReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of StudyList from a JSON string study_list_instance = StudyList.from_json(json) # print the JSON string representation of the object -print StudyList.to_json() +print(StudyList.to_json()) # convert the object into a dict study_list_dict = study_list_instance.to_dict() # create an instance of StudyList from a dict -study_list_form_dict = study_list.from_dict(study_list_dict) +study_list_from_dict = StudyList.from_dict(study_list_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) diff --git a/docs/StudyRequest.md b/docs/StudyRequest.md index c9db2cd..e0c6d58 100644 --- a/docs/StudyRequest.md +++ b/docs/StudyRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **doi** | **str** | Digital object identifier of the study. | [optional] @@ -27,12 +28,12 @@ json = "{}" # create an instance of StudyRequest from a JSON string study_request_instance = StudyRequest.from_json(json) # print the JSON string representation of the object -print StudyRequest.to_json() +print(StudyRequest.to_json()) # convert the object into a dict study_request_dict = study_request_instance.to_dict() # create an instance of StudyRequest from a dict -study_request_form_dict = study_request.from_dict(study_request_dict) +study_request_from_dict = StudyRequest.from_dict(study_request_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) diff --git a/docs/StudyRequestAllOf.md b/docs/StudyRequestAllOf.md deleted file mode 100644 index 26ed2c1..0000000 --- a/docs/StudyRequestAllOf.md +++ /dev/null @@ -1,28 +0,0 @@ -# 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) - - diff --git a/docs/StudyRequestRelationships.md b/docs/StudyRequestRelationships.md index c26642f..7563a5d 100644 --- a/docs/StudyRequestRelationships.md +++ b/docs/StudyRequestRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **analyses** | [**StudyRequestRelationshipsAnalyses**](StudyRequestRelationshipsAnalyses.md) | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of StudyRequestRelationships from a JSON string study_request_relationships_instance = StudyRequestRelationships.from_json(json) # print the JSON string representation of the object -print StudyRequestRelationships.to_json() +print(StudyRequestRelationships.to_json()) # convert the object into a dict study_request_relationships_dict = study_request_relationships_instance.to_dict() # create an instance of StudyRequestRelationships from a dict -study_request_relationships_form_dict = study_request_relationships.from_dict(study_request_relationships_dict) +study_request_relationships_from_dict = StudyRequestRelationships.from_dict(study_request_relationships_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) diff --git a/docs/StudyRequestRelationshipsAnalyses.md b/docs/StudyRequestRelationshipsAnalyses.md index f526939..822d308 100644 --- a/docs/StudyRequestRelationshipsAnalyses.md +++ b/docs/StudyRequestRelationshipsAnalyses.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of StudyRequestRelationshipsAnalyses from a JSON string study_request_relationships_analyses_instance = StudyRequestRelationshipsAnalyses.from_json(json) # print the JSON string representation of the object -print StudyRequestRelationshipsAnalyses.to_json() +print(StudyRequestRelationshipsAnalyses.to_json()) # convert the object into a dict study_request_relationships_analyses_dict = study_request_relationships_analyses_instance.to_dict() # create an instance of StudyRequestRelationshipsAnalyses from a dict -study_request_relationships_analyses_form_dict = study_request_relationships_analyses.from_dict(study_request_relationships_analyses_dict) +study_request_relationships_analyses_from_dict = StudyRequestRelationshipsAnalyses.from_dict(study_request_relationships_analyses_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) diff --git a/docs/StudyRequestRelationshipsAnalysesInner.md b/docs/StudyRequestRelationshipsAnalysesInner.md deleted file mode 100644 index ca88321..0000000 --- a/docs/StudyRequestRelationshipsAnalysesInner.md +++ /dev/null @@ -1,36 +0,0 @@ -# StudyRequestRelationshipsAnalysesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | A name of the contrast being performed. | [optional] -**description** | **str** | A long form description of how the contrast was performed | [optional] -**weights** | **List[float]** | Weight applied to each condition, must be the same length as the conditions attribute. | [optional] -**study** | **str** | | [optional] -**images** | [**List[AnalysisRequestRelationshipsImagesInner]**](AnalysisRequestRelationshipsImagesInner.md) | | [optional] -**points** | [**List[AnalysisRequestRelationshipsPointsInner]**](AnalysisRequestRelationshipsPointsInner.md) | | [optional] -**conditions** | [**List[AnalysisRequestRelationshipsConditionsInner]**](AnalysisRequestRelationshipsConditionsInner.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] - -## Example - -```python -from neurostore_sdk.models.study_request_relationships_analyses_inner import StudyRequestRelationshipsAnalysesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of StudyRequestRelationshipsAnalysesInner from a JSON string -study_request_relationships_analyses_inner_instance = StudyRequestRelationshipsAnalysesInner.from_json(json) -# print the JSON string representation of the object -print StudyRequestRelationshipsAnalysesInner.to_json() - -# convert the object into a dict -study_request_relationships_analyses_inner_dict = study_request_relationships_analyses_inner_instance.to_dict() -# create an instance of StudyRequestRelationshipsAnalysesInner from a dict -study_request_relationships_analyses_inner_form_dict = study_request_relationships_analyses_inner.from_dict(study_request_relationships_analyses_inner_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) - - diff --git a/docs/StudyReturn.md b/docs/StudyReturn.md index 3de3091..59f2c1b 100644 --- a/docs/StudyReturn.md +++ b/docs/StudyReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **doi** | **str** | Digital object identifier of the study. | [optional] @@ -22,7 +23,7 @@ Name | Type | Description | Notes **source_id** | **str** | | [optional] **source_updated_at** | **str** | | [optional] [readonly] **analyses** | [**StudyReturnRelationshipsAnalyses**](StudyReturnRelationshipsAnalyses.md) | | [optional] -**studysets** | [**List[StudyReturnAllOfStudysetsInner]**](StudyReturnAllOfStudysetsInner.md) | | [optional] +**studysets** | [**List[StudyReturnAllOfStudysets]**](StudyReturnAllOfStudysets.md) | | [optional] **has_coordinates** | **bool** | | [optional] **has_images** | **bool** | | [optional] **base_study** | **str** | | [optional] @@ -38,12 +39,12 @@ json = "{}" # create an instance of StudyReturn from a JSON string study_return_instance = StudyReturn.from_json(json) # print the JSON string representation of the object -print StudyReturn.to_json() +print(StudyReturn.to_json()) # convert the object into a dict study_return_dict = study_return_instance.to_dict() # create an instance of StudyReturn from a dict -study_return_form_dict = study_return.from_dict(study_return_dict) +study_return_from_dict = StudyReturn.from_dict(study_return_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) diff --git a/docs/StudyReturnAllOf.md b/docs/StudyReturnAllOf.md deleted file mode 100644 index c556fcc..0000000 --- a/docs/StudyReturnAllOf.md +++ /dev/null @@ -1,32 +0,0 @@ -# StudyReturnAllOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**studysets** | [**List[StudyReturnAllOfStudysetsInner]**](StudyReturnAllOfStudysetsInner.md) | | [optional] -**has_coordinates** | **bool** | | [optional] -**has_images** | **bool** | | [optional] -**base_study** | **str** | | [optional] -**pmcid** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.study_return_all_of import StudyReturnAllOf - -# TODO update the JSON string below -json = "{}" -# create an instance of StudyReturnAllOf from a JSON string -study_return_all_of_instance = StudyReturnAllOf.from_json(json) -# print the JSON string representation of the object -print StudyReturnAllOf.to_json() - -# convert the object into a dict -study_return_all_of_dict = study_return_all_of_instance.to_dict() -# create an instance of StudyReturnAllOf from a dict -study_return_all_of_form_dict = study_return_all_of.from_dict(study_return_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) - - diff --git a/docs/StudyReturnAllOfStudysets.md b/docs/StudyReturnAllOfStudysets.md index 4b314a6..ef84b5c 100644 --- a/docs/StudyReturnAllOfStudysets.md +++ b/docs/StudyReturnAllOfStudysets.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of StudyReturnAllOfStudysets from a JSON string study_return_all_of_studysets_instance = StudyReturnAllOfStudysets.from_json(json) # print the JSON string representation of the object -print StudyReturnAllOfStudysets.to_json() +print(StudyReturnAllOfStudysets.to_json()) # convert the object into a dict study_return_all_of_studysets_dict = study_return_all_of_studysets_instance.to_dict() # create an instance of StudyReturnAllOfStudysets from a dict -study_return_all_of_studysets_form_dict = study_return_all_of_studysets.from_dict(study_return_all_of_studysets_dict) +study_return_all_of_studysets_from_dict = StudyReturnAllOfStudysets.from_dict(study_return_all_of_studysets_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) diff --git a/docs/StudyReturnAllOfStudysetsInner.md b/docs/StudyReturnAllOfStudysetsInner.md deleted file mode 100644 index 2ad15a6..0000000 --- a/docs/StudyReturnAllOfStudysetsInner.md +++ /dev/null @@ -1,30 +0,0 @@ -# StudyReturnAllOfStudysetsInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**id** | **str** | | [optional] -**description** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.study_return_all_of_studysets_inner import StudyReturnAllOfStudysetsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of StudyReturnAllOfStudysetsInner from a JSON string -study_return_all_of_studysets_inner_instance = StudyReturnAllOfStudysetsInner.from_json(json) -# print the JSON string representation of the object -print StudyReturnAllOfStudysetsInner.to_json() - -# convert the object into a dict -study_return_all_of_studysets_inner_dict = study_return_all_of_studysets_inner_instance.to_dict() -# create an instance of StudyReturnAllOfStudysetsInner from a dict -study_return_all_of_studysets_inner_form_dict = study_return_all_of_studysets_inner.from_dict(study_return_all_of_studysets_inner_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) - - diff --git a/docs/StudyReturnAllOfStudysetsInnerOneOf.md b/docs/StudyReturnAllOfStudysetsInnerOneOf.md deleted file mode 100644 index 04f57f9..0000000 --- a/docs/StudyReturnAllOfStudysetsInnerOneOf.md +++ /dev/null @@ -1,30 +0,0 @@ -# StudyReturnAllOfStudysetsInnerOneOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**id** | **str** | | [optional] -**description** | **str** | | [optional] - -## Example - -```python -from neurostore_sdk.models.study_return_all_of_studysets_inner_one_of import StudyReturnAllOfStudysetsInnerOneOf - -# TODO update the JSON string below -json = "{}" -# create an instance of StudyReturnAllOfStudysetsInnerOneOf from a JSON string -study_return_all_of_studysets_inner_one_of_instance = StudyReturnAllOfStudysetsInnerOneOf.from_json(json) -# print the JSON string representation of the object -print StudyReturnAllOfStudysetsInnerOneOf.to_json() - -# convert the object into a dict -study_return_all_of_studysets_inner_one_of_dict = study_return_all_of_studysets_inner_one_of_instance.to_dict() -# create an instance of StudyReturnAllOfStudysetsInnerOneOf from a dict -study_return_all_of_studysets_inner_one_of_form_dict = study_return_all_of_studysets_inner_one_of.from_dict(study_return_all_of_studysets_inner_one_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) - - diff --git a/docs/StudyReturnAllOfStudysetsOneOf.md b/docs/StudyReturnAllOfStudysetsOneOf.md new file mode 100644 index 0000000..f1ba67a --- /dev/null +++ b/docs/StudyReturnAllOfStudysetsOneOf.md @@ -0,0 +1,31 @@ +# StudyReturnAllOfStudysetsOneOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**id** | **str** | | [optional] +**description** | **str** | | [optional] + +## Example + +```python +from neurostore_sdk.models.study_return_all_of_studysets_one_of import StudyReturnAllOfStudysetsOneOf + +# TODO update the JSON string below +json = "{}" +# create an instance of StudyReturnAllOfStudysetsOneOf from a JSON string +study_return_all_of_studysets_one_of_instance = StudyReturnAllOfStudysetsOneOf.from_json(json) +# print the JSON string representation of the object +print(StudyReturnAllOfStudysetsOneOf.to_json()) + +# convert the object into a dict +study_return_all_of_studysets_one_of_dict = study_return_all_of_studysets_one_of_instance.to_dict() +# create an instance of StudyReturnAllOfStudysetsOneOf from a dict +study_return_all_of_studysets_one_of_from_dict = StudyReturnAllOfStudysetsOneOf.from_dict(study_return_all_of_studysets_one_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) + + diff --git a/docs/StudyReturnRelationships.md b/docs/StudyReturnRelationships.md index a9ace12..4b0c870 100644 --- a/docs/StudyReturnRelationships.md +++ b/docs/StudyReturnRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **analyses** | [**StudyReturnRelationshipsAnalyses**](StudyReturnRelationshipsAnalyses.md) | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of StudyReturnRelationships from a JSON string study_return_relationships_instance = StudyReturnRelationships.from_json(json) # print the JSON string representation of the object -print StudyReturnRelationships.to_json() +print(StudyReturnRelationships.to_json()) # convert the object into a dict study_return_relationships_dict = study_return_relationships_instance.to_dict() # create an instance of StudyReturnRelationships from a dict -study_return_relationships_form_dict = study_return_relationships.from_dict(study_return_relationships_dict) +study_return_relationships_from_dict = StudyReturnRelationships.from_dict(study_return_relationships_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) diff --git a/docs/StudyReturnRelationshipsAnalyses.md b/docs/StudyReturnRelationshipsAnalyses.md index f4ab8e3..d8729dc 100644 --- a/docs/StudyReturnRelationshipsAnalyses.md +++ b/docs/StudyReturnRelationshipsAnalyses.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of StudyReturnRelationshipsAnalyses from a JSON string study_return_relationships_analyses_instance = StudyReturnRelationshipsAnalyses.from_json(json) # print the JSON string representation of the object -print StudyReturnRelationshipsAnalyses.to_json() +print(StudyReturnRelationshipsAnalyses.to_json()) # convert the object into a dict study_return_relationships_analyses_dict = study_return_relationships_analyses_instance.to_dict() # create an instance of StudyReturnRelationshipsAnalyses from a dict -study_return_relationships_analyses_form_dict = study_return_relationships_analyses.from_dict(study_return_relationships_analyses_dict) +study_return_relationships_analyses_from_dict = StudyReturnRelationshipsAnalyses.from_dict(study_return_relationships_analyses_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) diff --git a/docs/StudyReturnRelationshipsAnalysesInner.md b/docs/StudyReturnRelationshipsAnalysesInner.md deleted file mode 100644 index 497e5f1..0000000 --- a/docs/StudyReturnRelationshipsAnalysesInner.md +++ /dev/null @@ -1,39 +0,0 @@ -# StudyReturnRelationshipsAnalysesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | A name of the contrast being performed. | [optional] -**description** | **str** | A long form description of how the contrast was performed | [optional] -**weights** | **List[float]** | Weight applied to each condition, must be the same length as the conditions attribute. | [optional] -**created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] -**updated_at** | **str** | when was the resource last modified/updated. | [optional] [readonly] -**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] -**user** | **str** | who owns the resource | [optional] [readonly] -**study** | **str** | | [optional] -**images** | [**List[AnalysisReturnRelationshipsImagesInner]**](AnalysisReturnRelationshipsImagesInner.md) | | [optional] -**points** | [**List[AnalysisReturnRelationshipsPointsInner]**](AnalysisReturnRelationshipsPointsInner.md) | | [optional] -**conditions** | [**List[AnalysisReturnRelationshipsConditionsInner]**](AnalysisReturnRelationshipsConditionsInner.md) | | [optional] - -## Example - -```python -from neurostore_sdk.models.study_return_relationships_analyses_inner import StudyReturnRelationshipsAnalysesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of StudyReturnRelationshipsAnalysesInner from a JSON string -study_return_relationships_analyses_inner_instance = StudyReturnRelationshipsAnalysesInner.from_json(json) -# print the JSON string representation of the object -print StudyReturnRelationshipsAnalysesInner.to_json() - -# convert the object into a dict -study_return_relationships_analyses_inner_dict = study_return_relationships_analyses_inner_instance.to_dict() -# create an instance of StudyReturnRelationshipsAnalysesInner from a dict -study_return_relationships_analyses_inner_form_dict = study_return_relationships_analyses_inner.from_dict(study_return_relationships_analyses_inner_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) - - diff --git a/docs/StudysetBase.md b/docs/StudysetBase.md index 67802c2..108423b 100644 --- a/docs/StudysetBase.md +++ b/docs/StudysetBase.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Descriptive and human readable name of the studyset. | [optional] @@ -20,12 +21,12 @@ json = "{}" # create an instance of StudysetBase from a JSON string studyset_base_instance = StudysetBase.from_json(json) # print the JSON string representation of the object -print StudysetBase.to_json() +print(StudysetBase.to_json()) # convert the object into a dict studyset_base_dict = studyset_base_instance.to_dict() # create an instance of StudysetBase from a dict -studyset_base_form_dict = studyset_base.from_dict(studyset_base_dict) +studyset_base_from_dict = StudysetBase.from_dict(studyset_base_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) diff --git a/docs/StudysetList.md b/docs/StudysetList.md index 242a425..7c6f43e 100644 --- a/docs/StudysetList.md +++ b/docs/StudysetList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[StudysetReturn]**](StudysetReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of StudysetList from a JSON string studyset_list_instance = StudysetList.from_json(json) # print the JSON string representation of the object -print StudysetList.to_json() +print(StudysetList.to_json()) # convert the object into a dict studyset_list_dict = studyset_list_instance.to_dict() # create an instance of StudysetList from a dict -studyset_list_form_dict = studyset_list.from_dict(studyset_list_dict) +studyset_list_from_dict = StudysetList.from_dict(studyset_list_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) diff --git a/docs/StudysetRequest.md b/docs/StudysetRequest.md index 7800687..aa20f1d 100644 --- a/docs/StudysetRequest.md +++ b/docs/StudysetRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Descriptive and human readable name of the studyset. | [optional] @@ -24,12 +25,12 @@ json = "{}" # create an instance of StudysetRequest from a JSON string studyset_request_instance = StudysetRequest.from_json(json) # print the JSON string representation of the object -print StudysetRequest.to_json() +print(StudysetRequest.to_json()) # convert the object into a dict studyset_request_dict = studyset_request_instance.to_dict() # create an instance of StudysetRequest from a dict -studyset_request_form_dict = studyset_request.from_dict(studyset_request_dict) +studyset_request_from_dict = StudysetRequest.from_dict(studyset_request_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) diff --git a/docs/StudysetRequestRelationships.md b/docs/StudysetRequestRelationships.md index deafa0e..a0e6107 100644 --- a/docs/StudysetRequestRelationships.md +++ b/docs/StudysetRequestRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **studies** | **List[object]** | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of StudysetRequestRelationships from a JSON string studyset_request_relationships_instance = StudysetRequestRelationships.from_json(json) # print the JSON string representation of the object -print StudysetRequestRelationships.to_json() +print(StudysetRequestRelationships.to_json()) # convert the object into a dict studyset_request_relationships_dict = studyset_request_relationships_instance.to_dict() # create an instance of StudysetRequestRelationships from a dict -studyset_request_relationships_form_dict = studyset_request_relationships.from_dict(studyset_request_relationships_dict) +studyset_request_relationships_from_dict = StudysetRequestRelationships.from_dict(studyset_request_relationships_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) diff --git a/docs/StudysetRequestRelationshipsStudies.md b/docs/StudysetRequestRelationshipsStudies.md deleted file mode 100644 index 45d8318..0000000 --- a/docs/StudysetRequestRelationshipsStudies.md +++ /dev/null @@ -1,27 +0,0 @@ -# StudysetRequestRelationshipsStudies - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Example - -```python -from neurostore_sdk.models.studyset_request_relationships_studies import StudysetRequestRelationshipsStudies - -# TODO update the JSON string below -json = "{}" -# create an instance of StudysetRequestRelationshipsStudies from a JSON string -studyset_request_relationships_studies_instance = StudysetRequestRelationshipsStudies.from_json(json) -# print the JSON string representation of the object -print StudysetRequestRelationshipsStudies.to_json() - -# convert the object into a dict -studyset_request_relationships_studies_dict = studyset_request_relationships_studies_instance.to_dict() -# create an instance of StudysetRequestRelationshipsStudies from a dict -studyset_request_relationships_studies_form_dict = studyset_request_relationships_studies.from_dict(studyset_request_relationships_studies_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) - - diff --git a/docs/StudysetRequestRelationshipsStudiesInner.md b/docs/StudysetRequestRelationshipsStudiesInner.md deleted file mode 100644 index f7b0843..0000000 --- a/docs/StudysetRequestRelationshipsStudiesInner.md +++ /dev/null @@ -1,38 +0,0 @@ -# StudysetRequestRelationshipsStudiesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**doi** | **str** | Digital object identifier of the study. | [optional] -**name** | **str** | Title of the study. | [optional] -**metadata** | **object** | Metadata associated with the study not covered by the other study attributes. | [optional] -**description** | **str** | Long form description of the study, typically the abstract. | [optional] -**publication** | **str** | The journal/place of publication for the study. | [optional] -**pmid** | **str** | If the study was published on PubMed, place the PubMed ID here. | [optional] -**authors** | **str** | The authors on the publication of this study. | [optional] -**year** | **int** | The year this study was published. | [optional] -**analyses** | [**List[StudyRequestRelationshipsAnalysesInner]**](StudyRequestRelationshipsAnalysesInner.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] - -## Example - -```python -from neurostore_sdk.models.studyset_request_relationships_studies_inner import StudysetRequestRelationshipsStudiesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of StudysetRequestRelationshipsStudiesInner from a JSON string -studyset_request_relationships_studies_inner_instance = StudysetRequestRelationshipsStudiesInner.from_json(json) -# print the JSON string representation of the object -print StudysetRequestRelationshipsStudiesInner.to_json() - -# convert the object into a dict -studyset_request_relationships_studies_inner_dict = studyset_request_relationships_studies_inner_instance.to_dict() -# create an instance of StudysetRequestRelationshipsStudiesInner from a dict -studyset_request_relationships_studies_inner_form_dict = studyset_request_relationships_studies_inner.from_dict(studyset_request_relationships_studies_inner_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) - - diff --git a/docs/StudysetReturn.md b/docs/StudysetReturn.md index 74e7281..c1ec950 100644 --- a/docs/StudysetReturn.md +++ b/docs/StudysetReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Descriptive and human readable name of the studyset. | [optional] @@ -31,12 +32,12 @@ json = "{}" # create an instance of StudysetReturn from a JSON string studyset_return_instance = StudysetReturn.from_json(json) # print the JSON string representation of the object -print StudysetReturn.to_json() +print(StudysetReturn.to_json()) # convert the object into a dict studyset_return_dict = studyset_return_instance.to_dict() # create an instance of StudysetReturn from a dict -studyset_return_form_dict = studyset_return.from_dict(studyset_return_dict) +studyset_return_from_dict = StudysetReturn.from_dict(studyset_return_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) diff --git a/docs/StudysetReturnRelationships.md b/docs/StudysetReturnRelationships.md index 01b2fe3..3a79a83 100644 --- a/docs/StudysetReturnRelationships.md +++ b/docs/StudysetReturnRelationships.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **studies** | [**StudysetReturnRelationshipsStudies**](StudysetReturnRelationshipsStudies.md) | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of StudysetReturnRelationships from a JSON string studyset_return_relationships_instance = StudysetReturnRelationships.from_json(json) # print the JSON string representation of the object -print StudysetReturnRelationships.to_json() +print(StudysetReturnRelationships.to_json()) # convert the object into a dict studyset_return_relationships_dict = studyset_return_relationships_instance.to_dict() # create an instance of StudysetReturnRelationships from a dict -studyset_return_relationships_form_dict = studyset_return_relationships.from_dict(studyset_return_relationships_dict) +studyset_return_relationships_from_dict = StudysetReturnRelationships.from_dict(studyset_return_relationships_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) diff --git a/docs/StudysetReturnRelationshipsStudies.md b/docs/StudysetReturnRelationshipsStudies.md index b5b270e..09617d5 100644 --- a/docs/StudysetReturnRelationshipsStudies.md +++ b/docs/StudysetReturnRelationshipsStudies.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of StudysetReturnRelationshipsStudies from a JSON string studyset_return_relationships_studies_instance = StudysetReturnRelationshipsStudies.from_json(json) # print the JSON string representation of the object -print StudysetReturnRelationshipsStudies.to_json() +print(StudysetReturnRelationshipsStudies.to_json()) # convert the object into a dict studyset_return_relationships_studies_dict = studyset_return_relationships_studies_instance.to_dict() # create an instance of StudysetReturnRelationshipsStudies from a dict -studyset_return_relationships_studies_form_dict = studyset_return_relationships_studies.from_dict(studyset_return_relationships_studies_dict) +studyset_return_relationships_studies_from_dict = StudysetReturnRelationshipsStudies.from_dict(studyset_return_relationships_studies_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) diff --git a/docs/StudysetReturnRelationshipsStudiesInner.md b/docs/StudysetReturnRelationshipsStudiesInner.md deleted file mode 100644 index 0fe341a..0000000 --- a/docs/StudysetReturnRelationshipsStudiesInner.md +++ /dev/null @@ -1,45 +0,0 @@ -# StudysetReturnRelationshipsStudiesInner - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**doi** | **str** | Digital object identifier of the study. | [optional] -**name** | **str** | Title of the study. | [optional] -**metadata** | **object** | Metadata associated with the study not covered by the other study attributes. | [optional] -**description** | **str** | Long form description of the study, typically the abstract. | [optional] -**publication** | **str** | The journal/place of publication for the study. | [optional] -**pmid** | **str** | If the study was published on PubMed, place the PubMed ID here. | [optional] -**authors** | **str** | The authors on the publication of this study. | [optional] -**year** | **int** | The year this study was published. | [optional] -**created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] -**updated_at** | **str** | when was the resource last modified/updated. | [optional] [readonly] -**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] -**user** | **str** | who owns the resource | [optional] [readonly] -**source** | **str** | | [optional] -**source_id** | **str** | | [optional] -**source_updated_at** | **str** | | [optional] [readonly] -**analyses** | [**List[StudyReturnRelationshipsAnalysesInner]**](StudyReturnRelationshipsAnalysesInner.md) | | [optional] -**studysets** | [**List[StudyReturnAllOfStudysets]**](StudyReturnAllOfStudysets.md) | | [optional] - -## Example - -```python -from neurostore_sdk.models.studyset_return_relationships_studies_inner import StudysetReturnRelationshipsStudiesInner - -# TODO update the JSON string below -json = "{}" -# create an instance of StudysetReturnRelationshipsStudiesInner from a JSON string -studyset_return_relationships_studies_inner_instance = StudysetReturnRelationshipsStudiesInner.from_json(json) -# print the JSON string representation of the object -print StudysetReturnRelationshipsStudiesInner.to_json() - -# convert the object into a dict -studyset_return_relationships_studies_inner_dict = studyset_return_relationships_studies_inner_instance.to_dict() -# create an instance of StudysetReturnRelationshipsStudiesInner from a dict -studyset_return_relationships_studies_inner_form_dict = studyset_return_relationships_studies_inner.from_dict(studyset_return_relationships_studies_inner_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) - - diff --git a/docs/StudysetsApi.md b/docs/StudysetsApi.md index 793069b..e532a79 100644 --- a/docs/StudysetsApi.md +++ b/docs/StudysetsApi.md @@ -21,9 +21,8 @@ Get a list of studysets. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_list import StudysetList from neurostore_sdk.rest import ApiException @@ -59,7 +58,7 @@ with neurostore_sdk.ApiClient(configuration) as api_client: description = 'description_example' # str | search description field for a term (optional) source_id = '1234567890ab' # str | id of the resource you are either filtering/copying on (optional) unique = None # object | whether to list clones with originals (optional) - source = 'neurostore' # str | the source of the resource you would like to filter/copy from (optional) (default to 'neurostore') + source = neurostore # str | the source of the resource you would like to filter/copy from (optional) (default to neurostore) authors = 'authors_example' # str | search authors (optional) user_id = 'user_id_example' # str | user id you want to filter by (optional) @@ -73,8 +72,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| search for entries that contain the substring | [optional] @@ -87,7 +88,7 @@ Name | Type | Description | Notes **description** | **str**| search description field for a term | [optional] **source_id** | **str**| id of the resource you are either filtering/copying on | [optional] **unique** | [**object**](.md)| whether to list clones with originals | [optional] - **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to 'neurostore'] + **source** | **str**| the source of the resource you would like to filter/copy from | [optional] [default to neurostore] **authors** | **str**| search authors | [optional] **user_id** | **str**| user id you want to filter by | [optional] @@ -105,6 +106,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -121,9 +123,8 @@ delete a studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.rest import ApiException from pprint import pprint @@ -158,8 +159,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -178,6 +181,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -193,9 +197,8 @@ Retrieve the information of a studyset with the matching studyset ID. ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_return import StudysetReturn from neurostore_sdk.rest import ApiException @@ -226,8 +229,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -248,6 +253,7 @@ No authorization required - **Accept**: application/json, application/gzip ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | studyset found | - | @@ -265,9 +271,8 @@ Update a studyset. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_request import StudysetRequest from neurostore_sdk.models.studyset_return import StudysetReturn @@ -307,8 +312,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -328,6 +335,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -345,9 +353,8 @@ Create a studyset. ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.studyset_request import StudysetRequest from neurostore_sdk.models.studyset_return import StudysetReturn @@ -386,8 +393,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_request** | [**StudysetRequest**](StudysetRequest.md)| | [optional] @@ -406,6 +415,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/StudysetsIdGet404Response.md b/docs/StudysetsIdGet404Response.md index 93b1370..c925b35 100644 --- a/docs/StudysetsIdGet404Response.md +++ b/docs/StudysetsIdGet404Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **detail** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of StudysetsIdGet404Response from a JSON string studysets_id_get404_response_instance = StudysetsIdGet404Response.from_json(json) # print the JSON string representation of the object -print StudysetsIdGet404Response.to_json() +print(StudysetsIdGet404Response.to_json()) # convert the object into a dict studysets_id_get404_response_dict = studysets_id_get404_response_instance.to_dict() # create an instance of StudysetsIdGet404Response from a dict -studysets_id_get404_response_form_dict = studysets_id_get404_response.from_dict(studysets_id_get404_response_dict) +studysets_id_get404_response_from_dict = StudysetsIdGet404Response.from_dict(studysets_id_get404_response_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) diff --git a/docs/StudysetsIdPut422Response.md b/docs/StudysetsIdPut422Response.md index a0182fc..221383f 100644 --- a/docs/StudysetsIdPut422Response.md +++ b/docs/StudysetsIdPut422Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **detail** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of StudysetsIdPut422Response from a JSON string studysets_id_put422_response_instance = StudysetsIdPut422Response.from_json(json) # print the JSON string representation of the object -print StudysetsIdPut422Response.to_json() +print(StudysetsIdPut422Response.to_json()) # convert the object into a dict studysets_id_put422_response_dict = studysets_id_put422_response_instance.to_dict() # create an instance of StudysetsIdPut422Response from a dict -studysets_id_put422_response_form_dict = studysets_id_put422_response.from_dict(studysets_id_put422_response_dict) +studysets_id_put422_response_from_dict = StudysetsIdPut422Response.from_dict(studysets_id_put422_response_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) diff --git a/docs/User.md b/docs/User.md index 1cd602c..f63f116 100644 --- a/docs/User.md +++ b/docs/User.md @@ -3,6 +3,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | full name of user | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of User from a JSON string user_instance = User.from_json(json) # print the JSON string representation of the object -print User.to_json() +print(User.to_json()) # convert the object into a dict user_dict = user_instance.to_dict() # create an instance of User from a dict -user_form_dict = user.from_dict(user_dict) +user_from_dict = User.from_dict(user_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) diff --git a/docs/UserApi.md b/docs/UserApi.md index 7510ccb..989e230 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -20,9 +20,8 @@ get list of users ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.user_list import UserList from neurostore_sdk.rest import ApiException @@ -59,7 +58,9 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -76,6 +77,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -91,9 +93,8 @@ get an individual user ### Example + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.user import User from neurostore_sdk.rest import ApiException @@ -122,8 +123,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -142,6 +145,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -158,9 +162,8 @@ update an individual user ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.user import User from neurostore_sdk.rest import ApiException @@ -199,8 +202,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -220,6 +225,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -236,9 +242,8 @@ create a user ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurostore_sdk from neurostore_sdk.models.user import User from neurostore_sdk.rest import ApiException @@ -276,8 +281,10 @@ with neurostore_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| | [optional] @@ -296,6 +303,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/UserList.md b/docs/UserList.md index 1df11a8..e74191a 100644 --- a/docs/UserList.md +++ b/docs/UserList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[User]**](User.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of UserList from a JSON string user_list_instance = UserList.from_json(json) # print the JSON string representation of the object -print UserList.to_json() +print(UserList.to_json()) # convert the object into a dict user_list_dict = user_list_instance.to_dict() # create an instance of UserList from a dict -user_list_form_dict = user_list.from_dict(user_list_dict) +user_list_from_dict = UserList.from_dict(user_list_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) diff --git a/docs/UserResourceAttributes.md b/docs/UserResourceAttributes.md deleted file mode 100644 index 8ab78c9..0000000 --- a/docs/UserResourceAttributes.md +++ /dev/null @@ -1,30 +0,0 @@ -# UserResourceAttributes - -common resource attributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user** | **str** | who owns the resource | [optional] [readonly] -**username** | **str** | human readable username | [optional] - -## Example - -```python -from neurostore_sdk.models.user_resource_attributes import UserResourceAttributes - -# TODO update the JSON string below -json = "{}" -# create an instance of UserResourceAttributes from a JSON string -user_resource_attributes_instance = UserResourceAttributes.from_json(json) -# print the JSON string representation of the object -print UserResourceAttributes.to_json() - -# convert the object into a dict -user_resource_attributes_dict = user_resource_attributes_instance.to_dict() -# create an instance of UserResourceAttributes from a dict -user_resource_attributes_form_dict = user_resource_attributes.from_dict(user_resource_attributes_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) - - diff --git a/docs/UserlessResourceAttributes.md b/docs/UserlessResourceAttributes.md index bfbc672..83d97e4 100644 --- a/docs/UserlessResourceAttributes.md +++ b/docs/UserlessResourceAttributes.md @@ -3,6 +3,7 @@ common resource attributes not tied to a specific user ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_at** | **datetime** | time the resource was created on the database | [optional] [readonly] @@ -20,12 +21,12 @@ json = "{}" # create an instance of UserlessResourceAttributes from a JSON string userless_resource_attributes_instance = UserlessResourceAttributes.from_json(json) # print the JSON string representation of the object -print UserlessResourceAttributes.to_json() +print(UserlessResourceAttributes.to_json()) # convert the object into a dict userless_resource_attributes_dict = userless_resource_attributes_instance.to_dict() # create an instance of UserlessResourceAttributes from a dict -userless_resource_attributes_form_dict = userless_resource_attributes.from_dict(userless_resource_attributes_dict) +userless_resource_attributes_from_dict = UserlessResourceAttributes.from_dict(userless_resource_attributes_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) diff --git a/docs/WriteableResourceAttributes.md b/docs/WriteableResourceAttributes.md deleted file mode 100644 index d0d0164..0000000 --- a/docs/WriteableResourceAttributes.md +++ /dev/null @@ -1,30 +0,0 @@ -# WriteableResourceAttributes - -common resource attributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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] - -## Example - -```python -from neurostore_sdk.models.writeable_resource_attributes import WriteableResourceAttributes - -# TODO update the JSON string below -json = "{}" -# create an instance of WriteableResourceAttributes from a JSON string -writeable_resource_attributes_instance = WriteableResourceAttributes.from_json(json) -# print the JSON string representation of the object -print WriteableResourceAttributes.to_json() - -# convert the object into a dict -writeable_resource_attributes_dict = writeable_resource_attributes_instance.to_dict() -# create an instance of WriteableResourceAttributes from a dict -writeable_resource_attributes_form_dict = writeable_resource_attributes.from_dict(writeable_resource_attributes_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) - - diff --git a/neurostore_sdk/__init__.py b/neurostore_sdk/__init__.py index e0bdf6f..68631e1 100644 --- a/neurostore_sdk/__init__.py +++ b/neurostore_sdk/__init__.py @@ -5,14 +5,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 __version__ = "0.0.1" @@ -22,6 +22,11 @@ from neurostore_sdk.api.annotations_api import AnnotationsApi from neurostore_sdk.api.conditions_api import ConditionsApi from neurostore_sdk.api.images_api import ImagesApi +from neurostore_sdk.api.pipeline_configs_api import PipelineConfigsApi +from neurostore_sdk.api.pipeline_run_result_votes_api import PipelineRunResultVotesApi +from neurostore_sdk.api.pipeline_run_results_api import PipelineRunResultsApi +from neurostore_sdk.api.pipeline_runs_api import PipelineRunsApi +from neurostore_sdk.api.pipelines_api import PipelinesApi from neurostore_sdk.api.points_api import PointsApi from neurostore_sdk.api.store_api import StoreApi from neurostore_sdk.api.studies_api import StudiesApi @@ -84,15 +89,22 @@ from neurostore_sdk.models.image_relationships import ImageRelationships from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn -from neurostore_sdk.models.json_ld import JsonLd from neurostore_sdk.models.json_ld_context import JsonLdContext -from neurostore_sdk.models.metadata import Metadata from neurostore_sdk.models.nested_put_attributes import NestedPutAttributes from neurostore_sdk.models.note_collection_base import NoteCollectionBase from neurostore_sdk.models.note_collection_list import NoteCollectionList from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn -from neurostore_sdk.models.note_collection_return_all_of import NoteCollectionReturnAllOf +from neurostore_sdk.models.pipeline import Pipeline +from neurostore_sdk.models.pipeline_config import PipelineConfig +from neurostore_sdk.models.pipeline_config_list import PipelineConfigList +from neurostore_sdk.models.pipeline_list import PipelineList +from neurostore_sdk.models.pipeline_run import PipelineRun +from neurostore_sdk.models.pipeline_run_list import PipelineRunList +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from neurostore_sdk.models.pipeline_run_result_list import PipelineRunResultList +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from neurostore_sdk.models.pipeline_run_result_vote_list import PipelineRunResultVoteList from neurostore_sdk.models.point_base import PointBase from neurostore_sdk.models.point_common import PointCommon from neurostore_sdk.models.point_list import PointList @@ -101,19 +113,16 @@ from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn from neurostore_sdk.models.point_value import PointValue -from neurostore_sdk.models.readable_resource_attributes import ReadableResourceAttributes from neurostore_sdk.models.resource_attributes import ResourceAttributes from neurostore_sdk.models.study_base import StudyBase 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 -from neurostore_sdk.models.study_return_all_of import StudyReturnAllOf -from neurostore_sdk.models.study_return_all_of_studysets_inner import StudyReturnAllOfStudysetsInner -from neurostore_sdk.models.study_return_all_of_studysets_inner_one_of import StudyReturnAllOfStudysetsInnerOneOf +from neurostore_sdk.models.study_return_all_of_studysets import StudyReturnAllOfStudysets +from neurostore_sdk.models.study_return_all_of_studysets_one_of import StudyReturnAllOfStudysetsOneOf from neurostore_sdk.models.study_return_relationships import StudyReturnRelationships from neurostore_sdk.models.study_return_relationships_analyses import StudyReturnRelationshipsAnalyses from neurostore_sdk.models.studyset_base import StudysetBase @@ -127,6 +136,4 @@ from neurostore_sdk.models.studysets_id_put422_response import StudysetsIdPut422Response from neurostore_sdk.models.user import User from neurostore_sdk.models.user_list import UserList -from neurostore_sdk.models.user_resource_attributes import UserResourceAttributes from neurostore_sdk.models.userless_resource_attributes import UserlessResourceAttributes -from neurostore_sdk.models.writeable_resource_attributes import WriteableResourceAttributes diff --git a/neurostore_sdk/api/__init__.py b/neurostore_sdk/api/__init__.py index 2974a82..3a4adab 100644 --- a/neurostore_sdk/api/__init__.py +++ b/neurostore_sdk/api/__init__.py @@ -5,6 +5,11 @@ from neurostore_sdk.api.annotations_api import AnnotationsApi from neurostore_sdk.api.conditions_api import ConditionsApi from neurostore_sdk.api.images_api import ImagesApi +from neurostore_sdk.api.pipeline_configs_api import PipelineConfigsApi +from neurostore_sdk.api.pipeline_run_result_votes_api import PipelineRunResultVotesApi +from neurostore_sdk.api.pipeline_run_results_api import PipelineRunResultsApi +from neurostore_sdk.api.pipeline_runs_api import PipelineRunsApi +from neurostore_sdk.api.pipelines_api import PipelinesApi from neurostore_sdk.api.points_api import PointsApi from neurostore_sdk.api.store_api import StoreApi from neurostore_sdk.api.studies_api import StudiesApi diff --git a/neurostore_sdk/api/analyses_api.py b/neurostore_sdk/api/analyses_api.py index 49f1a2b..e6c7bce 100644 --- a/neurostore_sdk/api/analyses_api.py +++ b/neurostore_sdk/api/analyses_api.py @@ -3,27 +3,23 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, conlist, constr - +from pydantic import Field, StrictBool, StrictStr from typing import List, Optional - +from typing_extensions import Annotated from neurostore_sdk.models.analysis_list import AnalysisList from neurostore_sdk.models.analysis_request import AnalysisRequest from neurostore_sdk.models.analysis_return import AnalysisReturn @@ -31,36 +27,51 @@ from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class AnalysesApi(object): +class AnalysesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def analyses_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> AnalysisList: # noqa: E501 - """GET list of analyses # noqa: E501 - List all analyses performed across studies. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def analyses_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisList: + """GET list of analyses - >>> thread = api.analyses_get(search, sort, page, desc, page_size, name, description, nested, async_req=True) - >>> result = thread.get() + List all analyses performed across studies. :param search: search for entries that contain the substring :type search: str @@ -78,32 +89,84 @@ def analyses_get(self, search : Annotated[Optional[constr(strict=True, min_lengt :type description: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_get_with_http_info(search, sort, page, desc, page_size, name, description, nested, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET list of analyses # noqa: E501 - - List all analyses performed across studies. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.analyses_get_with_http_info(search, sort, page, desc, page_size, name, description, nested, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._analyses_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisList]: + """GET list of analyses + + List all analyses performed across studies. :param search: search for entries that contain the substring :type search: str @@ -121,1274 +184,2407 @@ def analyses_get_with_http_info(self, search : Annotated[Optional[constr(strict= :type description: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description', - 'nested' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._analyses_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + @validate_call + def analyses_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET list of analyses - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + List all analyses performed across studies. - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _analyses_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + name, + description, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if nested is not None: + + _query_params.append(('nested', nested)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnalysisList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/analyses/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def analyses_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE an analysis # noqa: E501 - delete an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def analyses_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE an analysis - >>> thread = api.analyses_id_delete(id, async_req=True) - >>> result = thread.get() + delete an analysis :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE an analysis # noqa: E501 - - delete an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.analyses_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE an analysis + + delete an analysis :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def analyses_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE an analysis + + delete an analysis + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _analyses_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/analyses/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def analyses_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> AnalysisReturn: # noqa: E501 - """GET an analysis # noqa: E501 - Information pertaining to a particular analysis within a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.analyses_id_get(id, nested, async_req=True) - >>> result = thread.get() + + @validate_call + def analyses_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisReturn: + """GET an analysis + + Information pertaining to a particular analysis within a study. :param id: (required) :type id: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_id_get_with_http_info(id, nested, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET an analysis # noqa: E501 - - Information pertaining to a particular analysis within a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.analyses_id_get_with_http_info(id, nested, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisReturn]: + """GET an analysis + + Information pertaining to a particular analysis within a study. :param id: (required) :type id: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'nested' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def analyses_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET an analysis + + Information pertaining to a particular analysis within a study. + + :param id: (required) + :type id: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _analyses_id_get_serialize( + self, + id, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if nested is not None: + + _query_params.append(('nested', nested)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnalysisReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def analyses_id_put(self, id : StrictStr, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> AnalysisReturn: # noqa: E501 - """PUT/update an analysis # noqa: E501 - Update an existing analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.analyses_id_put(id, analysis_request, async_req=True) - >>> result = thread.get() + + @validate_call + def analyses_id_put( + self, + id: StrictStr, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisReturn: + """PUT/update an analysis + + Update an existing analysis. :param id: (required) :type id: str :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_id_put_with_http_info(id, analysis_request, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_id_put_with_http_info(self, id : StrictStr, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update an analysis # noqa: E501 - - Update an existing analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.analyses_id_put_with_http_info(id, analysis_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._analyses_id_put_serialize( + id=id, + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_id_put_with_http_info( + self, + id: StrictStr, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisReturn]: + """PUT/update an analysis + + Update an existing analysis. :param id: (required) :type id: str :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._analyses_id_put_serialize( + id=id, + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'analysis_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def analyses_id_put_without_preload_content( + self, + id: StrictStr, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update an analysis + + Update an existing analysis. + + :param id: (required) + :type id: str + :param analysis_request: + :type analysis_request: AnalysisRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_id_put_serialize( + id=id, + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _analyses_id_put_serialize( + self, + id, + analysis_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['analysis_request'] is not None: - _body_params = _params['analysis_request'] + if analysis_request is not None: + _body_params = analysis_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnalysisReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def analyses_post(self, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> AnalysisReturn: # noqa: E501 - """POST/create an analysis # noqa: E501 - create an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.analyses_post(analysis_request, async_req=True) - >>> result = thread.get() + + @validate_call + def analyses_post( + self, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisReturn: + """POST/create an analysis + + create an analysis :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_post_with_http_info(analysis_request, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_post_with_http_info(self, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create an analysis # noqa: E501 - - create an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.analyses_post_with_http_info(analysis_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._analyses_post_serialize( + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_post_with_http_info( + self, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisReturn]: + """POST/create an analysis + + create an analysis :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._analyses_post_serialize( + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'analysis_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def analyses_post_without_preload_content( + self, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create an analysis + + create an analysis + + :param analysis_request: + :type analysis_request: AnalysisRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_post_serialize( + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _analyses_post_serialize( + self, + analysis_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['analysis_request'] is not None: - _body_params = _params['analysis_request'] + if analysis_request is not None: + _body_params = analysis_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnalysisReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/analyses/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotation_analyses_get(self, **kwargs) -> NoteCollectionList: # noqa: E501 - """Get annotation analyses # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_get(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def annotation_analyses_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionList: + """Get annotation analyses + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get annotation analyses # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotation_analyses_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionList]: + """Get annotation analyses + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def annotation_analyses_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get annotation analyses + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotation_analyses_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "NoteCollectionList", - '2XX': "NoteCollectionList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotation-analyses/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotation-analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotation_analyses_id_get(self, id : StrictStr, **kwargs) -> NoteCollectionReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def annotation_analyses_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionReturn: + """Your GET endpoint + :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionReturn]: + """Your GET endpoint - >>> thread = api.annotation_analyses_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotation_analyses_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotation_analyses_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "NoteCollectionReturn", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotation-analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotation_analyses_id_put(self, id : StrictStr, note_collection_request : Optional[NoteCollectionRequest] = None, **kwargs) -> NoteCollectionReturn: # noqa: E501 - """Your PUT endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_id_put(id, note_collection_request, async_req=True) - >>> result = thread.get() + @validate_call + def annotation_analyses_id_put( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionReturn: + """Your PUT endpoint + :param id: (required) :type id: str :param note_collection_request: :type note_collection_request: NoteCollectionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_id_put_with_http_info(id, note_collection_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_id_put_with_http_info(self, id : StrictStr, note_collection_request : Optional[NoteCollectionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your PUT endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_id_put_with_http_info( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionReturn]: + """Your PUT endpoint - >>> thread = api.annotation_analyses_id_put_with_http_info(id, note_collection_request, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param note_collection_request: :type note_collection_request: NoteCollectionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'note_collection_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotation_analyses_id_put_without_preload_content( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your PUT endpoint + + + :param id: (required) + :type id: str + :param note_collection_request: + :type note_collection_request: NoteCollectionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotation_analyses_id_put_serialize( + self, + id, + note_collection_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['note_collection_request'] is not None: - _body_params = _params['note_collection_request'] + if note_collection_request is not None: + _body_params = note_collection_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "NoteCollectionReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/annotation-analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotation_analyses_post(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> List[NoteCollectionReturn]: # noqa: E501 - """Your POST endpoint # noqa: E501 - This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_post(note_collection_request, async_req=True) - >>> result = thread.get() + + @validate_call + def annotation_analyses_post( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[NoteCollectionReturn]: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. :param note_collection_request: :type note_collection_request: List[NoteCollectionRequest] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[NoteCollectionReturn] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_post_with_http_info(note_collection_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_post_with_http_info(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your POST endpoint # noqa: E501 - - This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotation_analyses_post_with_http_info(note_collection_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_post_with_http_info( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[NoteCollectionReturn]]: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. :param note_collection_request: :type note_collection_request: List[NoteCollectionRequest] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[NoteCollectionReturn], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'note_collection_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotation_analyses_post_without_preload_content( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotation_analyses_post_serialize( + self, + note_collection_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + 'NoteCollectionRequest': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['note_collection_request'] is not None: - _body_params = _params['note_collection_request'] + if note_collection_request is not None: + _body_params = note_collection_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "List[NoteCollectionReturn]", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/annotation-analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/annotations_api.py b/neurostore_sdk/api/annotations_api.py index 4722fb8..9edbac6 100644 --- a/neurostore_sdk/api/annotations_api.py +++ b/neurostore_sdk/api/annotations_api.py @@ -3,27 +3,23 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conlist - +from pydantic import Field, StrictBool, StrictStr, field_validator from typing import List, Optional - +from typing_extensions import Annotated from neurostore_sdk.models.annotation_list import AnnotationList from neurostore_sdk.models.annotation_request import AnnotationRequest from neurostore_sdk.models.annotation_return import AnnotationReturn @@ -31,1174 +27,2192 @@ from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class AnnotationsApi(object): +class AnnotationsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def annotation_analyses_get(self, **kwargs) -> NoteCollectionList: # noqa: E501 - """Get annotation analyses # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def annotation_analyses_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionList: + """Get annotation analyses - >>> thread = api.annotation_analyses_get(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get annotation analyses # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotation_analyses_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionList]: + """Get annotation analyses + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def annotation_analyses_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get annotation analyses + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotation_analyses_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "NoteCollectionList", - '2XX': "NoteCollectionList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotation-analyses/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotation-analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def annotation_analyses_id_get(self, id : StrictStr, **kwargs) -> NoteCollectionReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def annotation_analyses_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionReturn: + """Your GET endpoint - >>> thread = api.annotation_analyses_id_get(id, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionReturn]: + """Your GET endpoint - >>> thread = api.annotation_analyses_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotation_analyses_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotation_analyses_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "NoteCollectionReturn", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotation-analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotation_analyses_id_put(self, id : StrictStr, note_collection_request : Optional[NoteCollectionRequest] = None, **kwargs) -> NoteCollectionReturn: # noqa: E501 - """Your PUT endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_id_put(id, note_collection_request, async_req=True) - >>> result = thread.get() + + @validate_call + def annotation_analyses_id_put( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionReturn: + """Your PUT endpoint + :param id: (required) :type id: str :param note_collection_request: :type note_collection_request: NoteCollectionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_id_put_with_http_info(id, note_collection_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_id_put_with_http_info(self, id : StrictStr, note_collection_request : Optional[NoteCollectionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your PUT endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_id_put_with_http_info( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionReturn]: + """Your PUT endpoint - >>> thread = api.annotation_analyses_id_put_with_http_info(id, note_collection_request, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param note_collection_request: :type note_collection_request: NoteCollectionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'note_collection_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotation_analyses_id_put_without_preload_content( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your PUT endpoint + + + :param id: (required) + :type id: str + :param note_collection_request: + :type note_collection_request: NoteCollectionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotation_analyses_id_put_serialize( + self, + id, + note_collection_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['note_collection_request'] is not None: - _body_params = _params['note_collection_request'] + if note_collection_request is not None: + _body_params = note_collection_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "NoteCollectionReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/annotation-analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotation_analyses_post(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> List[NoteCollectionReturn]: # noqa: E501 - """Your POST endpoint # noqa: E501 - This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_post(note_collection_request, async_req=True) - >>> result = thread.get() + @validate_call + def annotation_analyses_post( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[NoteCollectionReturn]: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. :param note_collection_request: :type note_collection_request: List[NoteCollectionRequest] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[NoteCollectionReturn] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_post_with_http_info(note_collection_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_post_with_http_info(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your POST endpoint # noqa: E501 - - This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotation_analyses_post_with_http_info(note_collection_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_post_with_http_info( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[NoteCollectionReturn]]: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. :param note_collection_request: :type note_collection_request: List[NoteCollectionRequest] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[NoteCollectionReturn], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'note_collection_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotation_analyses_post_without_preload_content( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotation_analyses_post_serialize( + self, + note_collection_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + 'NoteCollectionRequest': '', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['note_collection_request'] is not None: - _body_params = _params['note_collection_request'] + if note_collection_request is not None: + _body_params = note_collection_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "List[NoteCollectionReturn]", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/annotation-analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotations_get(self, studyset_id : Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, **kwargs) -> AnnotationList: # noqa: E501 - """Your GET endpoint # noqa: E501 - get annotations for an available studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_get(studyset_id, async_req=True) - >>> result = thread.get() + @validate_call + def annotations_get( + self, + studyset_id: Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationList: + """Your GET endpoint + + get annotations for an available studyset :param studyset_id: see all annotations connected to this studyset :type studyset_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_get_with_http_info(studyset_id, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_get_with_http_info(self, studyset_id : Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 - - get annotations for an available studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotations_get_with_http_info(studyset_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_get_serialize( + studyset_id=studyset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_get_with_http_info( + self, + studyset_id: Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationList]: + """Your GET endpoint + + get annotations for an available studyset :param studyset_id: see all annotations connected to this studyset :type studyset_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_get_serialize( + studyset_id=studyset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'studyset_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotations_get_without_preload_content( + self, + studyset_id: Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + get annotations for an available studyset + + :param studyset_id: see all annotations connected to this studyset + :type studyset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_get_serialize( + studyset_id=studyset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotations_get_serialize( + self, + studyset_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('studyset_id') is not None: # noqa: E501 - _query_params.append(('studyset_id', _params['studyset_id'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if studyset_id is not None: + + _query_params.append(('studyset_id', studyset_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotations/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotations/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotations_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE an annotation # noqa: E501 - delete annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def annotations_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE an annotation + + delete annotation :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE an annotation # noqa: E501 - - delete annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotations_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE an annotation + + delete annotation :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._annotations_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotations_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE an annotation + + delete annotation + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotations_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/annotations/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/annotations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotations_id_get(self, id : StrictStr, export : Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - get an individual annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_id_get(id, export, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_id_get( + self, + id: StrictStr, + export: Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationReturn: + """Your GET endpoint + + get an individual annotation :param id: (required) :type id: str :param export: return endpoint data in consumable/readable format :type export: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_id_get_with_http_info(id, export, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_get_with_http_info(self, id : StrictStr, export : Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 - - get an individual annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotations_id_get_with_http_info(id, export, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + export=export, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_id_get_with_http_info( + self, + id: StrictStr, + export: Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationReturn]: + """Your GET endpoint + + get an individual annotation :param id: (required) :type id: str :param export: return endpoint data in consumable/readable format :type export: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + export=export, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'export' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotations_id_get_without_preload_content( + self, + id: StrictStr, + export: Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + get an individual annotation + + :param id: (required) + :type id: str + :param export: return endpoint data in consumable/readable format + :type export: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + export=export, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotations_id_get_serialize( + self, + id, + export, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('export') is not None: # noqa: E501 - _query_params.append(('export', _params['export'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if export is not None: + + _query_params.append(('export', export)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotations/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotations_id_put(self, id : StrictStr, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Update an annotation # noqa: E501 - edit an existing annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_id_put(id, annotation_request, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_id_put( + self, + id: StrictStr, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationReturn: + """Update an annotation + + edit an existing annotation :param id: (required) :type id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_id_put_with_http_info(id, annotation_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_put_with_http_info(self, id : StrictStr, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an annotation # noqa: E501 - - edit an existing annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotations_id_put_with_http_info(id, annotation_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_id_put_with_http_info( + self, + id: StrictStr, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationReturn]: + """Update an annotation + + edit an existing annotation :param id: (required) :type id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'annotation_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotations_id_put_without_preload_content( + self, + id: StrictStr, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an annotation + + edit an existing annotation + + :param id: (required) + :type id: str + :param annotation_request: + :type annotation_request: AnnotationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotations_id_put_serialize( + self, + id, + annotation_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['annotation_request'] is not None: - _body_params = _params['annotation_request'] + if annotation_request is not None: + _body_params = annotation_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnnotationReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotations/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/annotations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def annotations_post(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Post Annotation # noqa: E501 - Create an annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def annotations_post( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationReturn: + """Post Annotation - >>> thread = api.annotations_post(source, source_id, annotation_request, async_req=True) - >>> result = thread.get() + Create an annotation :param source: the source of the resource you would like to filter/copy from :type source: str @@ -1206,32 +2220,74 @@ def annotations_post(self, source : Annotated[Optional[StrictStr], Field(descrip :type source_id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_post_with_http_info(source, source_id, annotation_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_post_with_http_info(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Post Annotation # noqa: E501 - - Create an annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotations_post_with_http_info(source, source_id, annotation_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_post_serialize( + source=source, + source_id=source_id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_post_with_http_info( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationReturn]: + """Post Annotation + + Create an annotation :param source: the source of the resource you would like to filter/copy from :type source: str @@ -1239,114 +2295,205 @@ def annotations_post_with_http_info(self, source : Annotated[Optional[StrictStr] :type source_id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_post_serialize( + source=source, + source_id=source_id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'source', - 'source_id', - 'annotation_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotations_post_without_preload_content( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Post Annotation + + Create an annotation + + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param annotation_request: + :type annotation_request: AnnotationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_post_serialize( + source=source, + source_id=source_id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotations_post_serialize( + self, + source, + source_id, + annotation_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) + _host = None - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if source is not None: + + _query_params.append(('source', source)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['annotation_request'] is not None: - _body_params = _params['annotation_request'] + if annotation_request is not None: + _body_params = annotation_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnnotationReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotations/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/annotations/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/conditions_api.py b/neurostore_sdk/api/conditions_api.py index 62371ce..bbaecb1 100644 --- a/neurostore_sdk/api/conditions_api.py +++ b/neurostore_sdk/api/conditions_api.py @@ -3,61 +3,71 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, constr - +from pydantic import Field, StrictBool, StrictStr from typing import Optional - +from typing_extensions import Annotated from neurostore_sdk.models.condition_list import ConditionList from neurostore_sdk.models.condition_request import ConditionRequest from neurostore_sdk.models.condition_return import ConditionReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class ConditionsApi(object): +class ConditionsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def conditions_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, **kwargs) -> ConditionList: # noqa: E501 - """GET Conditions # noqa: E501 - Get all conditions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def conditions_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionList: + """GET Conditions - >>> thread = api.conditions_get(search, sort, page, desc, page_size, name, description, async_req=True) - >>> result = thread.get() + Get all conditions :param search: search for entries that contain the substring :type search: str @@ -73,32 +83,82 @@ def conditions_get(self, search : Annotated[Optional[constr(strict=True, min_len :type name: str :param description: search description field for a term :type description: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_get_with_http_info(search, sort, page, desc, page_size, name, description, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET Conditions # noqa: E501 - - Get all conditions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.conditions_get_with_http_info(search, sort, page, desc, page_size, name, description, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._conditions_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionList]: + """GET Conditions + + Get all conditions :param search: search for entries that contain the substring :type search: str @@ -114,697 +174,1316 @@ def conditions_get_with_http_info(self, search : Annotated[Optional[constr(stric :type name: str :param description: search description field for a term :type description: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._conditions_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + @validate_call + def conditions_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET Conditions - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + Get all conditions - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _conditions_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + name, + description, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ConditionList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/conditions/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/conditions/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a condition # noqa: E501 - delete a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a condition + + delete a condition :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a condition # noqa: E501 - - delete a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.conditions_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._conditions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a condition + + delete a condition :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._conditions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def conditions_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a condition + + delete a condition + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _conditions_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/conditions/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/conditions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_id_get(self, id : StrictStr, **kwargs) -> ConditionReturn: # noqa: E501 - """GET a condition # noqa: E501 - Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_id_get(id, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionReturn: + """GET a condition + + Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET a condition # noqa: E501 - - Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.conditions_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._conditions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionReturn]: + """GET a condition + + Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._conditions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def conditions_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a condition + + Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _conditions_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ConditionReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/conditions/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/conditions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_id_put(self, id : StrictStr, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ConditionReturn: # noqa: E501 - """PUT/update a condition # noqa: E501 - update a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_id_put(id, condition_request, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_id_put( + self, + id: StrictStr, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionReturn: + """PUT/update a condition + + update a condition :param id: (required) :type id: str :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_id_put_with_http_info(id, condition_request, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_id_put_with_http_info(self, id : StrictStr, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a condition # noqa: E501 - - update a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.conditions_id_put_with_http_info(id, condition_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._conditions_id_put_serialize( + id=id, + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_id_put_with_http_info( + self, + id: StrictStr, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionReturn]: + """PUT/update a condition + + update a condition :param id: (required) :type id: str :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._conditions_id_put_serialize( + id=id, + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'condition_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def conditions_id_put_without_preload_content( + self, + id: StrictStr, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a condition + + update a condition + + :param id: (required) + :type id: str + :param condition_request: + :type condition_request: ConditionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_id_put_serialize( + id=id, + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _conditions_id_put_serialize( + self, + id, + condition_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['condition_request'] is not None: - _body_params = _params['condition_request'] + if condition_request is not None: + _body_params = condition_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ConditionReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/conditions/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/conditions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_post(self, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ConditionReturn: # noqa: E501 - """POST/Create a condition # noqa: E501 - Create a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_post(condition_request, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_post( + self, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionReturn: + """POST/Create a condition + + Create a condition :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_post_with_http_info(condition_request, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_post_with_http_info(self, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/Create a condition # noqa: E501 - - Create a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.conditions_post_with_http_info(condition_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._conditions_post_serialize( + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_post_with_http_info( + self, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionReturn]: + """POST/Create a condition + + Create a condition :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._conditions_post_serialize( + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'condition_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def conditions_post_without_preload_content( + self, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/Create a condition + + Create a condition + + :param condition_request: + :type condition_request: ConditionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_post_serialize( + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _conditions_post_serialize( + self, + condition_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['condition_request'] is not None: - _body_params = _params['condition_request'] + if condition_request is not None: + _body_params = condition_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ConditionReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/conditions/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/conditions/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/default_api.py b/neurostore_sdk/api/default_api.py deleted file mode 100644 index c16147c..0000000 --- a/neurostore_sdk/api/default_api.py +++ /dev/null @@ -1,749 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -import re # noqa: F401 -import io -import warnings - -from pydantic import validate_arguments, ValidationError -from typing_extensions import Annotated - -from pydantic import Field, StrictBool, StrictStr, conint, constr - -from typing import Optional - -from neurostore_sdk.models.base_studies_post200_response import BaseStudiesPost200Response -from neurostore_sdk.models.base_studies_post_request import BaseStudiesPostRequest -from neurostore_sdk.models.base_study import BaseStudy -from neurostore_sdk.models.base_study_list import BaseStudyList -from neurostore_sdk.models.base_study_return import BaseStudyReturn - -from neurostore_sdk.api_client import ApiClient -from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) - - -class DefaultApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - @validate_arguments - def base_studies_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, publication : Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> BaseStudyList: # noqa: E501 - """ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_get(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, async_req=True) - >>> result = thread.get() - - :param search: search for entries that contain the substring - :type search: str - :param sort: Parameter to sort results on - :type sort: str - :param page: page of results - :type page: int - :param desc: sort results by descending order (as opposed to ascending order) - :type desc: bool - :param page_size: number of results to show on a page - :type page_size: int - :param name: search the name field for a term - :type name: str - :param description: search description field for a term - :type description: str - :param authors: search authors - :type authors: str - :param level: select between studies with group results or meta results - :type level: str - :param data_type: whether searching for studies that contain coordinates, images, or both - :type data_type: str - :param publication: search for papers from a particular journal - :type publication: str - :param pmid: search for particular pmid - :type pmid: str - :param doi: search for study with specific doi - :type doi: str - :param flat: do not return any embedded relationships. When set, it is incompatible with nested. - :type flat: bool - :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested - :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_get_with_http_info(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, publication : Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_get_with_http_info(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, async_req=True) - >>> result = thread.get() - - :param search: search for entries that contain the substring - :type search: str - :param sort: Parameter to sort results on - :type sort: str - :param page: page of results - :type page: int - :param desc: sort results by descending order (as opposed to ascending order) - :type desc: bool - :param page_size: number of results to show on a page - :type page_size: int - :param name: search the name field for a term - :type name: str - :param description: search description field for a term - :type description: str - :param authors: search authors - :type authors: str - :param level: select between studies with group results or meta results - :type level: str - :param data_type: whether searching for studies that contain coordinates, images, or both - :type data_type: str - :param publication: search for papers from a particular journal - :type publication: str - :param pmid: search for particular pmid - :type pmid: str - :param doi: search for study with specific doi - :type doi: str - :param flat: do not return any embedded relationships. When set, it is incompatible with nested. - :type flat: bool - :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested - :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description', - 'authors', - 'level', - 'data_type', - 'publication', - 'pmid', - 'doi', - 'flat', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) - - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) - - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - - if _params.get('authors') is not None: # noqa: E501 - _query_params.append(('authors', _params['authors'])) - - if _params.get('level') is not None: # noqa: E501 - _query_params.append(('level', _params['level'].value)) - - if _params.get('data_type') is not None: # noqa: E501 - _query_params.append(('data_type', _params['data_type'].value)) - - if _params.get('publication') is not None: # noqa: E501 - _query_params.append(('publication', _params['publication'])) - - if _params.get('pmid') is not None: # noqa: E501 - _query_params.append(('pmid', _params['pmid'])) - - if _params.get('doi') is not None: # noqa: E501 - _query_params.append(('doi', _params['doi'])) - - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) - - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "BaseStudyList", - } - - return self.api_client.call_api( - '/base-studies/', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def base_studies_id_get(self, id : StrictStr, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> BaseStudyReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_id_get(id, flat, info, async_req=True) - >>> result = thread.get() - - :param id: (required) - :type id: str - :param flat: do not return any embedded relationships. When set, it is incompatible with nested. - :type flat: bool - :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested - :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_id_get_with_http_info(id, flat, info, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_id_get_with_http_info(self, id : StrictStr, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_id_get_with_http_info(id, flat, info, async_req=True) - >>> result = thread.get() - - :param id: (required) - :type id: str - :param flat: do not return any embedded relationships. When set, it is incompatible with nested. - :type flat: bool - :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested - :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id', - 'flat', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] - - - # process the query parameters - _query_params = [] - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) - - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "BaseStudyReturn", - } - - return self.api_client.call_api( - '/base-studies/{id}', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def base_studies_id_put(self, id : StrictStr, base_study : Optional[BaseStudy] = None, **kwargs) -> BaseStudyReturn: # noqa: E501 - """ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_id_put(id, base_study, async_req=True) - >>> result = thread.get() - - :param id: (required) - :type id: str - :param base_study: - :type base_study: BaseStudy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_id_put_with_http_info(id, base_study, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_id_put_with_http_info(self, id : StrictStr, base_study : Optional[BaseStudy] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_id_put_with_http_info(id, base_study, async_req=True) - >>> result = thread.get() - - :param id: (required) - :type id: str - :param base_study: - :type base_study: BaseStudy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id', - 'base_study' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['base_study'] is not None: - _body_params = _params['base_study'] - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "BaseStudyReturn", - } - - return self.api_client.call_api( - '/base-studies/{id}', 'PUT', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def base_studies_post(self, base_studies_post_request : Optional[BaseStudiesPostRequest] = None, **kwargs) -> BaseStudiesPost200Response: # noqa: E501 - """ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_post(base_studies_post_request, async_req=True) - >>> result = thread.get() - - :param base_studies_post_request: - :type base_studies_post_request: BaseStudiesPostRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudiesPost200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_post_with_http_info(base_studies_post_request, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_post_with_http_info(self, base_studies_post_request : Optional[BaseStudiesPostRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.base_studies_post_with_http_info(base_studies_post_request, async_req=True) - >>> result = thread.get() - - :param base_studies_post_request: - :type base_studies_post_request: BaseStudiesPostRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudiesPost200Response, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'base_studies_post_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] - ) - - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['base_studies_post_request'] is not None: - _body_params = _params['base_studies_post_request'] - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "BaseStudiesPost200Response", - } - - return self.api_client.call_api( - '/base-studies/', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) diff --git a/neurostore_sdk/api/images_api.py b/neurostore_sdk/api/images_api.py index 046516b..d5b0208 100644 --- a/neurostore_sdk/api/images_api.py +++ b/neurostore_sdk/api/images_api.py @@ -3,61 +3,73 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, constr - +from pydantic import Field, StrictBool, StrictStr from typing import Optional - +from typing_extensions import Annotated from neurostore_sdk.models.image_list import ImageList from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class ImagesApi(object): +class ImagesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def images_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, filename : Annotated[Optional[StrictStr], Field(description="search filename field")] = None, analysis_name : Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, value_type : Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, space : Annotated[Optional[StrictStr], Field(description="search space field")] = None, **kwargs) -> ImageList: # noqa: E501 - """GET a list of images # noqa: E501 - Retrieve and list images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def images_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + filename: Annotated[Optional[StrictStr], Field(description="search filename field")] = None, + analysis_name: Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, + value_type: Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, + space: Annotated[Optional[StrictStr], Field(description="search space field")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageList: + """GET a list of images - >>> thread = api.images_get(search, sort, page, desc, page_size, filename, analysis_name, value_type, space, async_req=True) - >>> result = thread.get() + Retrieve and list images. :param search: search for entries that contain the substring :type search: str @@ -77,32 +89,86 @@ def images_get(self, search : Annotated[Optional[constr(strict=True, min_length= :type value_type: str :param space: search space field :type space: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_get_with_http_info(search, sort, page, desc, page_size, filename, analysis_name, value_type, space, **kwargs) # noqa: E501 - - @validate_arguments - def images_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, filename : Annotated[Optional[StrictStr], Field(description="search filename field")] = None, analysis_name : Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, value_type : Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, space : Annotated[Optional[StrictStr], Field(description="search space field")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of images # noqa: E501 - - Retrieve and list images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.images_get_with_http_info(search, sort, page, desc, page_size, filename, analysis_name, value_type, space, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._images_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + filename=filename, + analysis_name=analysis_name, + value_type=value_type, + space=space, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + filename: Annotated[Optional[StrictStr], Field(description="search filename field")] = None, + analysis_name: Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, + value_type: Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, + space: Annotated[Optional[StrictStr], Field(description="search space field")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageList]: + """GET a list of images + + Retrieve and list images. :param search: search for entries that contain the substring :type search: str @@ -122,705 +188,1336 @@ def images_get_with_http_info(self, search : Annotated[Optional[constr(strict=Tr :type value_type: str :param space: search space field :type space: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'filename', - 'analysis_name', - 'value_type', - 'space' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._images_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + filename=filename, + analysis_name=analysis_name, + value_type=value_type, + space=space, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + @validate_call + def images_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + filename: Annotated[Optional[StrictStr], Field(description="search filename field")] = None, + analysis_name: Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, + value_type: Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, + space: Annotated[Optional[StrictStr], Field(description="search space field")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of images - if _params.get('filename') is not None: # noqa: E501 - _query_params.append(('filename', _params['filename'])) + Retrieve and list images. - if _params.get('analysis_name') is not None: # noqa: E501 - _query_params.append(('analysis_name', _params['analysis_name'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param filename: search filename field + :type filename: str + :param analysis_name: search analysis_name field + :type analysis_name: str + :param value_type: search value_type field + :type value_type: str + :param space: search space field + :type space: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + filename=filename, + analysis_name=analysis_name, + value_type=value_type, + space=space, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('value_type') is not None: # noqa: E501 - _query_params.append(('value_type', _params['value_type'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _images_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + filename, + analysis_name, + value_type, + space, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('space') is not None: # noqa: E501 - _query_params.append(('space', _params['space'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if filename is not None: + + _query_params.append(('filename', filename)) + + if analysis_name is not None: + + _query_params.append(('analysis_name', analysis_name)) + + if value_type is not None: + + _query_params.append(('value_type', value_type)) + + if space is not None: + + _query_params.append(('space', space)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ImageList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/images/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/images/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def images_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE an image # noqa: E501 - delete an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.images_id_delete(id, async_req=True) - >>> result = thread.get() + + @validate_call + def images_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE an image + + delete an image :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def images_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE an image # noqa: E501 - - delete an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.images_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._images_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE an image + + delete an image :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._images_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE an image + + delete an image + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _images_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/images/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/images/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def images_id_get(self, id : StrictStr, **kwargs) -> ImageReturn: # noqa: E501 - """GET an image # noqa: E501 - Retrieve information about a particular image from an analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.images_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def images_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageReturn: + """GET an image + + Retrieve information about a particular image from an analysis. :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def images_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET an image # noqa: E501 - - Retrieve information about a particular image from an analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.images_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._images_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageReturn]: + """GET an image + + Retrieve information about a particular image from an analysis. :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._images_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET an image + + Retrieve information about a particular image from an analysis. + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _images_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ImageReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/images/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/images/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def images_id_put(self, id : StrictStr, image_request : Optional[ImageRequest] = None, **kwargs) -> ImageReturn: # noqa: E501 - """PUT/update an image # noqa: E501 - Update a specific image. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def images_id_put( + self, + id: StrictStr, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageReturn: + """PUT/update an image - >>> thread = api.images_id_put(id, image_request, async_req=True) - >>> result = thread.get() + Update a specific image. :param id: (required) :type id: str :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_id_put_with_http_info(id, image_request, **kwargs) # noqa: E501 - - @validate_arguments - def images_id_put_with_http_info(self, id : StrictStr, image_request : Optional[ImageRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update an image # noqa: E501 - - Update a specific image. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.images_id_put_with_http_info(id, image_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._images_id_put_serialize( + id=id, + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_id_put_with_http_info( + self, + id: StrictStr, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageReturn]: + """PUT/update an image + + Update a specific image. :param id: (required) :type id: str :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._images_id_put_serialize( + id=id, + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'image_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_id_put_without_preload_content( + self, + id: StrictStr, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update an image + + Update a specific image. + + :param id: (required) + :type id: str + :param image_request: + :type image_request: ImageRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_id_put_serialize( + id=id, + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _images_id_put_serialize( + self, + id, + image_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['image_request'] is not None: - _body_params = _params['image_request'] + if image_request is not None: + _body_params = image_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ImageReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/images/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/images/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def images_post(self, image_request : Optional[ImageRequest] = None, **kwargs) -> ImageReturn: # noqa: E501 - """POST/create an image # noqa: E501 - Create an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.images_post(image_request, async_req=True) - >>> result = thread.get() + + @validate_call + def images_post( + self, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageReturn: + """POST/create an image + + Create an image :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_post_with_http_info(image_request, **kwargs) # noqa: E501 - - @validate_arguments - def images_post_with_http_info(self, image_request : Optional[ImageRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create an image # noqa: E501 - - Create an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.images_post_with_http_info(image_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._images_post_serialize( + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_post_with_http_info( + self, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageReturn]: + """POST/create an image + + Create an image :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._images_post_serialize( + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'image_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def images_post_without_preload_content( + self, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create an image + + Create an image + + :param image_request: + :type image_request: ImageRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_post_serialize( + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _images_post_serialize( + self, + image_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['image_request'] is not None: - _body_params = _params['image_request'] + if image_request is not None: + _body_params = image_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ImageReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/images/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/images/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/pipeline_configs_api.py b/neurostore_sdk/api/pipeline_configs_api.py new file mode 100644 index 0000000..56813a5 --- /dev/null +++ b/neurostore_sdk/api/pipeline_configs_api.py @@ -0,0 +1,1330 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Optional +from neurostore_sdk.models.pipeline_config import PipelineConfig +from neurostore_sdk.models.pipeline_config_list import PipelineConfigList + +from neurostore_sdk.api_client import ApiClient, RequestSerialized +from neurostore_sdk.api_response import ApiResponse +from neurostore_sdk.rest import RESTResponseType + + +class PipelineConfigsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def pipeline_configs_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineConfigList: + """GET a list of pipeline configs + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineConfigList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_configs_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineConfigList]: + """GET a list of pipeline configs + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineConfigList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_configs_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of pipeline configs + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineConfigList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_configs_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-configs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_configs_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a pipeline config by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_configs_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a pipeline config by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_configs_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a pipeline config by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_configs_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pipeline-configs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_configs_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineConfig: + """GET a pipeline config by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineConfig", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_configs_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineConfig]: + """GET a pipeline config by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineConfig", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_configs_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a pipeline config by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineConfig", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_configs_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-configs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_configs_id_put( + self, + id: StrictStr, + pipeline_config: Optional[PipelineConfig] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """PUT/update a pipeline config by ID + + + :param id: (required) + :type id: str + :param pipeline_config: + :type pipeline_config: PipelineConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_put_serialize( + id=id, + pipeline_config=pipeline_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_configs_id_put_with_http_info( + self, + id: StrictStr, + pipeline_config: Optional[PipelineConfig] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """PUT/update a pipeline config by ID + + + :param id: (required) + :type id: str + :param pipeline_config: + :type pipeline_config: PipelineConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_put_serialize( + id=id, + pipeline_config=pipeline_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_configs_id_put_without_preload_content( + self, + id: StrictStr, + pipeline_config: Optional[PipelineConfig] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a pipeline config by ID + + + :param id: (required) + :type id: str + :param pipeline_config: + :type pipeline_config: PipelineConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_id_put_serialize( + id=id, + pipeline_config=pipeline_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_configs_id_put_serialize( + self, + id, + pipeline_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_config is not None: + _body_params = pipeline_config + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/pipeline-configs/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_configs_post( + self, + pipeline_config: Optional[PipelineConfig] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """POST/create a pipeline config + + + :param pipeline_config: + :type pipeline_config: PipelineConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_post_serialize( + pipeline_config=pipeline_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_configs_post_with_http_info( + self, + pipeline_config: Optional[PipelineConfig] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """POST/create a pipeline config + + + :param pipeline_config: + :type pipeline_config: PipelineConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_post_serialize( + pipeline_config=pipeline_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_configs_post_without_preload_content( + self, + pipeline_config: Optional[PipelineConfig] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a pipeline config + + + :param pipeline_config: + :type pipeline_config: PipelineConfig + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_configs_post_serialize( + pipeline_config=pipeline_config, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_configs_post_serialize( + self, + pipeline_config, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_config is not None: + _body_params = pipeline_config + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pipeline-configs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/pipeline_run_result_votes_api.py b/neurostore_sdk/api/pipeline_run_result_votes_api.py new file mode 100644 index 0000000..9770df7 --- /dev/null +++ b/neurostore_sdk/api/pipeline_run_result_votes_api.py @@ -0,0 +1,1330 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Optional +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from neurostore_sdk.models.pipeline_run_result_vote_list import PipelineRunResultVoteList + +from neurostore_sdk.api_client import ApiClient, RequestSerialized +from neurostore_sdk.api_response import ApiResponse +from neurostore_sdk.rest import RESTResponseType + + +class PipelineRunResultVotesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def pipeline_run_result_votes_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineRunResultVoteList: + """GET a list of pipeline run result votes + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultVoteList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_result_votes_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineRunResultVoteList]: + """GET a list of pipeline run result votes + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultVoteList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_result_votes_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of pipeline run result votes + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultVoteList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_result_votes_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-run-result-votes/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_delete( + self, + pipeline_run_result_vote_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_delete_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_delete_with_http_info( + self, + pipeline_run_result_vote_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_delete_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_delete_without_preload_content( + self, + pipeline_run_result_vote_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_delete_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_result_votes_pipeline_run_result_vote_id_delete_serialize( + self, + pipeline_run_result_vote_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_result_vote_id is not None: + _path_params['pipeline_run_result_vote_id'] = pipeline_run_result_vote_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pipeline-run-result-votes/{pipeline_run_result_vote_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_get( + self, + pipeline_run_result_vote_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineRunResultVote: + """GET a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_get_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultVote", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_get_with_http_info( + self, + pipeline_run_result_vote_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineRunResultVote]: + """GET a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_get_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultVote", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_get_without_preload_content( + self, + pipeline_run_result_vote_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_get_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultVote", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_result_votes_pipeline_run_result_vote_id_get_serialize( + self, + pipeline_run_result_vote_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_result_vote_id is not None: + _path_params['pipeline_run_result_vote_id'] = pipeline_run_result_vote_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-run-result-votes/{pipeline_run_result_vote_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_put( + self, + pipeline_run_result_vote_id: StrictStr, + pipeline_run_result_vote: Optional[PipelineRunResultVote] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """PUT/update a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param pipeline_run_result_vote: + :type pipeline_run_result_vote: PipelineRunResultVote + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_put_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + pipeline_run_result_vote=pipeline_run_result_vote, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_put_with_http_info( + self, + pipeline_run_result_vote_id: StrictStr, + pipeline_run_result_vote: Optional[PipelineRunResultVote] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """PUT/update a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param pipeline_run_result_vote: + :type pipeline_run_result_vote: PipelineRunResultVote + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_put_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + pipeline_run_result_vote=pipeline_run_result_vote, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_result_votes_pipeline_run_result_vote_id_put_without_preload_content( + self, + pipeline_run_result_vote_id: StrictStr, + pipeline_run_result_vote: Optional[PipelineRunResultVote] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a pipeline run result vote by ID + + + :param pipeline_run_result_vote_id: (required) + :type pipeline_run_result_vote_id: str + :param pipeline_run_result_vote: + :type pipeline_run_result_vote: PipelineRunResultVote + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_pipeline_run_result_vote_id_put_serialize( + pipeline_run_result_vote_id=pipeline_run_result_vote_id, + pipeline_run_result_vote=pipeline_run_result_vote, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_result_votes_pipeline_run_result_vote_id_put_serialize( + self, + pipeline_run_result_vote_id, + pipeline_run_result_vote, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_result_vote_id is not None: + _path_params['pipeline_run_result_vote_id'] = pipeline_run_result_vote_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_run_result_vote is not None: + _body_params = pipeline_run_result_vote + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/pipeline-run-result-votes/{pipeline_run_result_vote_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_result_votes_post( + self, + pipeline_run_result_vote: Optional[PipelineRunResultVote] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """POST/create a pipeline run result vote + + + :param pipeline_run_result_vote: + :type pipeline_run_result_vote: PipelineRunResultVote + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_post_serialize( + pipeline_run_result_vote=pipeline_run_result_vote, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_result_votes_post_with_http_info( + self, + pipeline_run_result_vote: Optional[PipelineRunResultVote] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """POST/create a pipeline run result vote + + + :param pipeline_run_result_vote: + :type pipeline_run_result_vote: PipelineRunResultVote + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_post_serialize( + pipeline_run_result_vote=pipeline_run_result_vote, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_result_votes_post_without_preload_content( + self, + pipeline_run_result_vote: Optional[PipelineRunResultVote] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a pipeline run result vote + + + :param pipeline_run_result_vote: + :type pipeline_run_result_vote: PipelineRunResultVote + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_result_votes_post_serialize( + pipeline_run_result_vote=pipeline_run_result_vote, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_result_votes_post_serialize( + self, + pipeline_run_result_vote, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_run_result_vote is not None: + _body_params = pipeline_run_result_vote + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pipeline-run-result-votes/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/pipeline_run_results_api.py b/neurostore_sdk/api/pipeline_run_results_api.py new file mode 100644 index 0000000..d0e5f66 --- /dev/null +++ b/neurostore_sdk/api/pipeline_run_results_api.py @@ -0,0 +1,1330 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Optional +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from neurostore_sdk.models.pipeline_run_result_list import PipelineRunResultList + +from neurostore_sdk.api_client import ApiClient, RequestSerialized +from neurostore_sdk.api_response import ApiResponse +from neurostore_sdk.rest import RESTResponseType + + +class PipelineRunResultsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def pipeline_run_results_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineRunResultList: + """GET a list of pipeline run results + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_results_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineRunResultList]: + """GET a list of pipeline run results + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_results_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of pipeline run results + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResultList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_results_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-run-results/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_delete( + self, + pipeline_run_result_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_delete_serialize( + pipeline_run_result_id=pipeline_run_result_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_delete_with_http_info( + self, + pipeline_run_result_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_delete_serialize( + pipeline_run_result_id=pipeline_run_result_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_delete_without_preload_content( + self, + pipeline_run_result_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_delete_serialize( + pipeline_run_result_id=pipeline_run_result_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_results_pipeline_run_result_id_delete_serialize( + self, + pipeline_run_result_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_result_id is not None: + _path_params['pipeline_run_result_id'] = pipeline_run_result_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pipeline-run-results/{pipeline_run_result_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_get( + self, + pipeline_run_result_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineRunResult: + """GET a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_get_serialize( + pipeline_run_result_id=pipeline_run_result_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResult", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_get_with_http_info( + self, + pipeline_run_result_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineRunResult]: + """GET a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_get_serialize( + pipeline_run_result_id=pipeline_run_result_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResult", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_get_without_preload_content( + self, + pipeline_run_result_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_get_serialize( + pipeline_run_result_id=pipeline_run_result_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunResult", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_results_pipeline_run_result_id_get_serialize( + self, + pipeline_run_result_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_result_id is not None: + _path_params['pipeline_run_result_id'] = pipeline_run_result_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-run-results/{pipeline_run_result_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_put( + self, + pipeline_run_result_id: StrictStr, + pipeline_run_result: Optional[PipelineRunResult] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """PUT/update a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param pipeline_run_result: + :type pipeline_run_result: PipelineRunResult + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_put_serialize( + pipeline_run_result_id=pipeline_run_result_id, + pipeline_run_result=pipeline_run_result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_put_with_http_info( + self, + pipeline_run_result_id: StrictStr, + pipeline_run_result: Optional[PipelineRunResult] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """PUT/update a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param pipeline_run_result: + :type pipeline_run_result: PipelineRunResult + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_put_serialize( + pipeline_run_result_id=pipeline_run_result_id, + pipeline_run_result=pipeline_run_result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_results_pipeline_run_result_id_put_without_preload_content( + self, + pipeline_run_result_id: StrictStr, + pipeline_run_result: Optional[PipelineRunResult] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a pipeline run result by ID + + + :param pipeline_run_result_id: (required) + :type pipeline_run_result_id: str + :param pipeline_run_result: + :type pipeline_run_result: PipelineRunResult + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_pipeline_run_result_id_put_serialize( + pipeline_run_result_id=pipeline_run_result_id, + pipeline_run_result=pipeline_run_result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_results_pipeline_run_result_id_put_serialize( + self, + pipeline_run_result_id, + pipeline_run_result, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_result_id is not None: + _path_params['pipeline_run_result_id'] = pipeline_run_result_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_run_result is not None: + _body_params = pipeline_run_result + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/pipeline-run-results/{pipeline_run_result_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_run_results_post( + self, + pipeline_run_result: Optional[PipelineRunResult] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """POST/create a pipeline run result + + + :param pipeline_run_result: + :type pipeline_run_result: PipelineRunResult + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_post_serialize( + pipeline_run_result=pipeline_run_result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_run_results_post_with_http_info( + self, + pipeline_run_result: Optional[PipelineRunResult] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """POST/create a pipeline run result + + + :param pipeline_run_result: + :type pipeline_run_result: PipelineRunResult + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_post_serialize( + pipeline_run_result=pipeline_run_result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_run_results_post_without_preload_content( + self, + pipeline_run_result: Optional[PipelineRunResult] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a pipeline run result + + + :param pipeline_run_result: + :type pipeline_run_result: PipelineRunResult + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_run_results_post_serialize( + pipeline_run_result=pipeline_run_result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_run_results_post_serialize( + self, + pipeline_run_result, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_run_result is not None: + _body_params = pipeline_run_result + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pipeline-run-results/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/pipeline_runs_api.py b/neurostore_sdk/api/pipeline_runs_api.py new file mode 100644 index 0000000..20ab109 --- /dev/null +++ b/neurostore_sdk/api/pipeline_runs_api.py @@ -0,0 +1,1330 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Optional +from neurostore_sdk.models.pipeline_run import PipelineRun +from neurostore_sdk.models.pipeline_run_list import PipelineRunList + +from neurostore_sdk.api_client import ApiClient, RequestSerialized +from neurostore_sdk.api_response import ApiResponse +from neurostore_sdk.rest import RESTResponseType + + +class PipelineRunsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def pipeline_runs_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineRunList: + """GET a list of pipeline runs + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_runs_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineRunList]: + """GET a list of pipeline runs + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_runs_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of pipeline runs + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRunList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_runs_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-runs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_runs_pipeline_run_id_delete( + self, + pipeline_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_delete_serialize( + pipeline_run_id=pipeline_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_runs_pipeline_run_id_delete_with_http_info( + self, + pipeline_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_delete_serialize( + pipeline_run_id=pipeline_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_runs_pipeline_run_id_delete_without_preload_content( + self, + pipeline_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_delete_serialize( + pipeline_run_id=pipeline_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_runs_pipeline_run_id_delete_serialize( + self, + pipeline_run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_id is not None: + _path_params['pipeline_run_id'] = pipeline_run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pipeline-runs/{pipeline_run_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_runs_pipeline_run_id_get( + self, + pipeline_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineRun: + """GET a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_get_serialize( + pipeline_run_id=pipeline_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRun", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_runs_pipeline_run_id_get_with_http_info( + self, + pipeline_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineRun]: + """GET a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_get_serialize( + pipeline_run_id=pipeline_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRun", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_runs_pipeline_run_id_get_without_preload_content( + self, + pipeline_run_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_get_serialize( + pipeline_run_id=pipeline_run_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineRun", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_runs_pipeline_run_id_get_serialize( + self, + pipeline_run_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_id is not None: + _path_params['pipeline_run_id'] = pipeline_run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipeline-runs/{pipeline_run_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_runs_pipeline_run_id_put( + self, + pipeline_run_id: StrictStr, + pipeline_run: Optional[PipelineRun] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """PUT/update a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param pipeline_run: + :type pipeline_run: PipelineRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_put_serialize( + pipeline_run_id=pipeline_run_id, + pipeline_run=pipeline_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_runs_pipeline_run_id_put_with_http_info( + self, + pipeline_run_id: StrictStr, + pipeline_run: Optional[PipelineRun] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """PUT/update a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param pipeline_run: + :type pipeline_run: PipelineRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_put_serialize( + pipeline_run_id=pipeline_run_id, + pipeline_run=pipeline_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_runs_pipeline_run_id_put_without_preload_content( + self, + pipeline_run_id: StrictStr, + pipeline_run: Optional[PipelineRun] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a pipeline run by ID + + + :param pipeline_run_id: (required) + :type pipeline_run_id: str + :param pipeline_run: + :type pipeline_run: PipelineRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_pipeline_run_id_put_serialize( + pipeline_run_id=pipeline_run_id, + pipeline_run=pipeline_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_runs_pipeline_run_id_put_serialize( + self, + pipeline_run_id, + pipeline_run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pipeline_run_id is not None: + _path_params['pipeline_run_id'] = pipeline_run_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_run is not None: + _body_params = pipeline_run + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/pipeline-runs/{pipeline_run_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipeline_runs_post( + self, + pipeline_run: Optional[PipelineRun] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """POST/create a pipeline run + + + :param pipeline_run: + :type pipeline_run: PipelineRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_post_serialize( + pipeline_run=pipeline_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipeline_runs_post_with_http_info( + self, + pipeline_run: Optional[PipelineRun] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """POST/create a pipeline run + + + :param pipeline_run: + :type pipeline_run: PipelineRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_post_serialize( + pipeline_run=pipeline_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipeline_runs_post_without_preload_content( + self, + pipeline_run: Optional[PipelineRun] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a pipeline run + + + :param pipeline_run: + :type pipeline_run: PipelineRun + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipeline_runs_post_serialize( + pipeline_run=pipeline_run, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipeline_runs_post_serialize( + self, + pipeline_run, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline_run is not None: + _body_params = pipeline_run + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pipeline-runs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/pipelines_api.py b/neurostore_sdk/api/pipelines_api.py new file mode 100644 index 0000000..efe54a5 --- /dev/null +++ b/neurostore_sdk/api/pipelines_api.py @@ -0,0 +1,1330 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import StrictStr +from typing import Optional +from neurostore_sdk.models.pipeline import Pipeline +from neurostore_sdk.models.pipeline_list import PipelineList + +from neurostore_sdk.api_client import ApiClient, RequestSerialized +from neurostore_sdk.api_response import ApiResponse +from neurostore_sdk.rest import RESTResponseType + + +class PipelinesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def pipelines_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PipelineList: + """GET a list of pipelines + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipelines_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PipelineList]: + """GET a list of pipelines + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipelines_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of pipelines + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PipelineList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipelines_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipelines/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipelines_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a pipeline by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipelines_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a pipeline by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipelines_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a pipeline by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipelines_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/pipelines/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipelines_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Pipeline: + """GET a pipeline by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Pipeline", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipelines_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Pipeline]: + """GET a pipeline by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Pipeline", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipelines_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a pipeline by ID + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Pipeline", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipelines_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/pipelines/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipelines_id_put( + self, + id: StrictStr, + pipeline: Optional[Pipeline] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """PUT/update a pipeline by ID + + + :param id: (required) + :type id: str + :param pipeline: + :type pipeline: Pipeline + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_put_serialize( + id=id, + pipeline=pipeline, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipelines_id_put_with_http_info( + self, + id: StrictStr, + pipeline: Optional[Pipeline] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """PUT/update a pipeline by ID + + + :param id: (required) + :type id: str + :param pipeline: + :type pipeline: Pipeline + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_put_serialize( + id=id, + pipeline=pipeline, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipelines_id_put_without_preload_content( + self, + id: StrictStr, + pipeline: Optional[Pipeline] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a pipeline by ID + + + :param id: (required) + :type id: str + :param pipeline: + :type pipeline: Pipeline + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_id_put_serialize( + id=id, + pipeline=pipeline, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipelines_id_put_serialize( + self, + id, + pipeline, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline is not None: + _body_params = pipeline + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/pipelines/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def pipelines_post( + self, + pipeline: Optional[Pipeline] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """POST/create a pipeline + + + :param pipeline: + :type pipeline: Pipeline + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_post_serialize( + pipeline=pipeline, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def pipelines_post_with_http_info( + self, + pipeline: Optional[Pipeline] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """POST/create a pipeline + + + :param pipeline: + :type pipeline: Pipeline + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_post_serialize( + pipeline=pipeline, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def pipelines_post_without_preload_content( + self, + pipeline: Optional[Pipeline] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a pipeline + + + :param pipeline: + :type pipeline: Pipeline + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._pipelines_post_serialize( + pipeline=pipeline, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _pipelines_post_serialize( + self, + pipeline, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pipeline is not None: + _body_params = pipeline + + + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/pipelines/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/points_api.py b/neurostore_sdk/api/points_api.py index ac51000..4268f9b 100644 --- a/neurostore_sdk/api/points_api.py +++ b/neurostore_sdk/api/points_api.py @@ -3,752 +3,1367 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from pydantic import StrictStr - from typing import Optional - from neurostore_sdk.models.point_list import PointList from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class PointsApi(object): +class PointsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def points_get(self, **kwargs) -> PointList: # noqa: E501 - """Get Points # noqa: E501 - list points in database # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def points_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointList: + """Get Points - >>> thread = api.points_get(async_req=True) - >>> result = thread.get() + list points in database - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def points_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get Points # noqa: E501 - - list points in database # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.points_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._points_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointList]: + """Get Points + + list points in database + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._points_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def points_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Points + + list points in database + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _points_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "PointList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/points/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/points/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def points_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a point # noqa: E501 - delete a point # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def points_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a point - >>> thread = api.points_id_delete(id, async_req=True) - >>> result = thread.get() + delete a point :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def points_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a point # noqa: E501 - - delete a point # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.points_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._points_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a point + + delete a point :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._points_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def points_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a point + + delete a point + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _points_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/points/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/points/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def points_id_get(self, id : StrictStr, **kwargs) -> PointReturn: # noqa: E501 - """GET a point # noqa: E501 - Information about a particular MRI coordinate # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.points_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def points_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointReturn: + """GET a point + + Information about a particular MRI coordinate :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def points_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET a point # noqa: E501 - - Information about a particular MRI coordinate # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.points_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._points_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointReturn]: + """GET a point + + Information about a particular MRI coordinate :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._points_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def points_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a point + + Information about a particular MRI coordinate + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _points_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "PointReturn", - '404': None, - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/points/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/points/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def points_id_put(self, id : StrictStr, point_request : Optional[PointRequest] = None, **kwargs) -> PointReturn: # noqa: E501 - """PUT/update a point # noqa: E501 - Update a particular MRI coordinate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.points_id_put(id, point_request, async_req=True) - >>> result = thread.get() + @validate_call + def points_id_put( + self, + id: StrictStr, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointReturn: + """PUT/update a point + + Update a particular MRI coordinate. :param id: (required) :type id: str :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_id_put_with_http_info(id, point_request, **kwargs) # noqa: E501 - - @validate_arguments - def points_id_put_with_http_info(self, id : StrictStr, point_request : Optional[PointRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a point # noqa: E501 - - Update a particular MRI coordinate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.points_id_put_with_http_info(id, point_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._points_id_put_serialize( + id=id, + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_id_put_with_http_info( + self, + id: StrictStr, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointReturn]: + """PUT/update a point + + Update a particular MRI coordinate. :param id: (required) :type id: str :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._points_id_put_serialize( + id=id, + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'point_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def points_id_put_without_preload_content( + self, + id: StrictStr, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a point + + Update a particular MRI coordinate. + + :param id: (required) + :type id: str + :param point_request: + :type point_request: PointRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_id_put_serialize( + id=id, + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _points_id_put_serialize( + self, + id, + point_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['point_request'] is not None: - _body_params = _params['point_request'] + if point_request is not None: + _body_params = point_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "PointReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/points/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/points/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def points_post(self, point_request : Optional[PointRequest] = None, **kwargs) -> PointReturn: # noqa: E501 - """POST Points # noqa: E501 - add a point to an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.points_post(point_request, async_req=True) - >>> result = thread.get() + + @validate_call + def points_post( + self, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointReturn: + """POST Points + + add a point to an analysis :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_post_with_http_info(point_request, **kwargs) # noqa: E501 - - @validate_arguments - def points_post_with_http_info(self, point_request : Optional[PointRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST Points # noqa: E501 - - add a point to an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.points_post_with_http_info(point_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._points_post_serialize( + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_post_with_http_info( + self, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointReturn]: + """POST Points + + add a point to an analysis :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._points_post_serialize( + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'point_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def points_post_without_preload_content( + self, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST Points + + add a point to an analysis + + :param point_request: + :type point_request: PointRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_post_serialize( + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _points_post_serialize( + self, + point_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['point_request'] is not None: - _body_params = _params['point_request'] + if point_request is not None: + _body_params = point_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "PointReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/points/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/points/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/store_api.py b/neurostore_sdk/api/store_api.py index d3a5d3d..101636c 100644 --- a/neurostore_sdk/api/store_api.py +++ b/neurostore_sdk/api/store_api.py @@ -3,27 +3,23 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, conlist, constr - +from pydantic import Field, StrictBool, StrictStr, field_validator from typing import Any, List, Optional - +from typing_extensions import Annotated from neurostore_sdk.models.analysis_list import AnalysisList from neurostore_sdk.models.analysis_request import AnalysisRequest from neurostore_sdk.models.analysis_return import AnalysisReturn @@ -53,36 +49,51 @@ from neurostore_sdk.models.studyset_request import StudysetRequest from neurostore_sdk.models.studyset_return import StudysetReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class StoreApi(object): +class StoreApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def analyses_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> AnalysisList: # noqa: E501 - """GET list of analyses # noqa: E501 - List all analyses performed across studies. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def analyses_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisList: + """GET list of analyses - >>> thread = api.analyses_get(search, sort, page, desc, page_size, name, description, nested, async_req=True) - >>> result = thread.get() + List all analyses performed across studies. :param search: search for entries that contain the substring :type search: str @@ -100,32 +111,84 @@ def analyses_get(self, search : Annotated[Optional[constr(strict=True, min_lengt :type description: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_get_with_http_info(search, sort, page, desc, page_size, name, description, nested, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET list of analyses # noqa: E501 + """ # noqa: E501 + + _param = self._analyses_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - List all analyses performed across studies. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisList]: + """GET list of analyses - >>> thread = api.analyses_get_with_http_info(search, sort, page, desc, page_size, name, description, nested, async_req=True) - >>> result = thread.get() + List all analyses performed across studies. :param search: search for entries that contain the substring :type search: str @@ -143,1861 +206,3516 @@ def analyses_get_with_http_info(self, search : Annotated[Optional[constr(strict= :type description: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description', - 'nested' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._analyses_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + @validate_call + def analyses_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET list of analyses - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + List all analyses performed across studies. - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _analyses_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + name, + description, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if nested is not None: + + _query_params.append(('nested', nested)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnalysisList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/analyses/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def analyses_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE an analysis # noqa: E501 - delete an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.analyses_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def analyses_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE an analysis + + delete an analysis :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE an analysis # noqa: E501 + """ # noqa: E501 + + _param = self._analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE an analysis - >>> thread = api.analyses_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete an analysis :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def analyses_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE an analysis + + delete an analysis + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _analyses_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/analyses/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def analyses_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> AnalysisReturn: # noqa: E501 - """GET an analysis # noqa: E501 - Information pertaining to a particular analysis within a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.analyses_id_get(id, nested, async_req=True) - >>> result = thread.get() + + @validate_call + def analyses_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisReturn: + """GET an analysis + + Information pertaining to a particular analysis within a study. :param id: (required) :type id: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_id_get_with_http_info(id, nested, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET an analysis # noqa: E501 + """ # noqa: E501 + + _param = self._analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Information pertaining to a particular analysis within a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisReturn]: + """GET an analysis - >>> thread = api.analyses_id_get_with_http_info(id, nested, async_req=True) - >>> result = thread.get() + Information pertaining to a particular analysis within a study. :param id: (required) :type id: str :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) :type nested: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'nested' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def analyses_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET an analysis + + Information pertaining to a particular analysis within a study. + + :param id: (required) + :type id: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _analyses_id_get_serialize( + self, + id, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if nested is not None: + + _query_params.append(('nested', nested)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnalysisReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def analyses_id_put(self, id : StrictStr, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> AnalysisReturn: # noqa: E501 - """PUT/update an analysis # noqa: E501 - Update an existing analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def analyses_id_put( + self, + id: StrictStr, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisReturn: + """PUT/update an analysis - >>> thread = api.analyses_id_put(id, analysis_request, async_req=True) - >>> result = thread.get() + Update an existing analysis. :param id: (required) :type id: str :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_id_put_with_http_info(id, analysis_request, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_id_put_with_http_info(self, id : StrictStr, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update an analysis # noqa: E501 + """ # noqa: E501 + + _param = self._analyses_id_put_serialize( + id=id, + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Update an existing analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_id_put_with_http_info( + self, + id: StrictStr, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisReturn]: + """PUT/update an analysis - >>> thread = api.analyses_id_put_with_http_info(id, analysis_request, async_req=True) - >>> result = thread.get() + Update an existing analysis. :param id: (required) :type id: str :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._analyses_id_put_serialize( + id=id, + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'analysis_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def analyses_id_put_without_preload_content( + self, + id: StrictStr, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update an analysis + + Update an existing analysis. + + :param id: (required) + :type id: str + :param analysis_request: + :type analysis_request: AnalysisRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_id_put_serialize( + id=id, + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _analyses_id_put_serialize( + self, + id, + analysis_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['analysis_request'] is not None: - _body_params = _params['analysis_request'] + if analysis_request is not None: + _body_params = analysis_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnalysisReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def analyses_post(self, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> AnalysisReturn: # noqa: E501 - """POST/create an analysis # noqa: E501 - create an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def analyses_post( + self, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnalysisReturn: + """POST/create an analysis - >>> thread = api.analyses_post(analysis_request, async_req=True) - >>> result = thread.get() + create an analysis :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.analyses_post_with_http_info(analysis_request, **kwargs) # noqa: E501 - - @validate_arguments - def analyses_post_with_http_info(self, analysis_request : Optional[AnalysisRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create an analysis # noqa: E501 + """ # noqa: E501 + + _param = self._analyses_post_serialize( + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def analyses_post_with_http_info( + self, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnalysisReturn]: + """POST/create an analysis - >>> thread = api.analyses_post_with_http_info(analysis_request, async_req=True) - >>> result = thread.get() + create an analysis :param analysis_request: :type analysis_request: AnalysisRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._analyses_post_serialize( + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'analysis_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def analyses_post_without_preload_content( + self, + analysis_request: Optional[AnalysisRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create an analysis + + create an analysis - # process the path parameters - _path_params = {} + :param analysis_request: + :type analysis_request: AnalysisRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._analyses_post_serialize( + analysis_request=analysis_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnalysisReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _analyses_post_serialize( + self, + analysis_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['analysis_request'] is not None: - _body_params = _params['analysis_request'] + if analysis_request is not None: + _body_params = analysis_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnalysisReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/analyses/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotation_analyses_get(self, **kwargs) -> NoteCollectionList: # noqa: E501 - """Get annotation analyses # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_get(async_req=True) - >>> result = thread.get() + @validate_call + def annotation_analyses_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionList: + """Get annotation analyses + - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get annotation analyses # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotation_analyses_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionList]: + """Get annotation analyses + + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def annotation_analyses_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get annotation analyses + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionList", + '2XX': "NoteCollectionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotation_analyses_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "NoteCollectionList", - '2XX': "NoteCollectionList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotation-analyses/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotation-analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotation_analyses_id_get(self, id : StrictStr, **kwargs) -> NoteCollectionReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def annotation_analyses_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionReturn: + """Your GET endpoint + :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionReturn]: + """Your GET endpoint - >>> thread = api.annotation_analyses_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotation_analyses_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotation_analyses_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "NoteCollectionReturn", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotation-analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotation_analyses_id_put(self, id : StrictStr, note_collection_request : Optional[NoteCollectionRequest] = None, **kwargs) -> NoteCollectionReturn: # noqa: E501 - """Your PUT endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_id_put(id, note_collection_request, async_req=True) - >>> result = thread.get() + @validate_call + def annotation_analyses_id_put( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NoteCollectionReturn: + """Your PUT endpoint + :param id: (required) :type id: str :param note_collection_request: :type note_collection_request: NoteCollectionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NoteCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_id_put_with_http_info(id, note_collection_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_id_put_with_http_info(self, id : StrictStr, note_collection_request : Optional[NoteCollectionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your PUT endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_id_put_with_http_info( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NoteCollectionReturn]: + """Your PUT endpoint - >>> thread = api.annotation_analyses_id_put_with_http_info(id, note_collection_request, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param note_collection_request: :type note_collection_request: NoteCollectionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(NoteCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'note_collection_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotation_analyses_id_put_without_preload_content( + self, + id: StrictStr, + note_collection_request: Optional[NoteCollectionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your PUT endpoint + + + :param id: (required) + :type id: str + :param note_collection_request: + :type note_collection_request: NoteCollectionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_id_put_serialize( + id=id, + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "NoteCollectionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotation_analyses_id_put_serialize( + self, + id, + note_collection_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['note_collection_request'] is not None: - _body_params = _params['note_collection_request'] + if note_collection_request is not None: + _body_params = note_collection_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "NoteCollectionReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/annotation-analyses/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotation_analyses_post(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> List[NoteCollectionReturn]: # noqa: E501 - """Your POST endpoint # noqa: E501 - This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotation_analyses_post(note_collection_request, async_req=True) - >>> result = thread.get() + @validate_call + def annotation_analyses_post( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[NoteCollectionReturn]: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. :param note_collection_request: :type note_collection_request: List[NoteCollectionRequest] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[NoteCollectionReturn] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotation_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotation_analyses_post_with_http_info(note_collection_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotation_analyses_post_with_http_info(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your POST endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotation_analyses_post_with_http_info( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[NoteCollectionReturn]]: + """Your POST endpoint - >>> thread = api.annotation_analyses_post_with_http_info(note_collection_request, async_req=True) - >>> result = thread.get() + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. :param note_collection_request: :type note_collection_request: List[NoteCollectionRequest] - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[NoteCollectionReturn], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'note_collection_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def annotation_analyses_post_without_preload_content( + self, + note_collection_request: Optional[List[NoteCollectionRequest]] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your POST endpoint + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotation_analyses_post_serialize( + note_collection_request=note_collection_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotation_analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[NoteCollectionReturn]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotation_analyses_post_serialize( + self, + note_collection_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'NoteCollectionRequest': '', + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['note_collection_request'] is not None: - _body_params = _params['note_collection_request'] + if note_collection_request is not None: + _body_params = note_collection_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "List[NoteCollectionReturn]", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotation-analyses/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/annotation-analyses/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def annotations_get(self, studyset_id : Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, **kwargs) -> AnnotationList: # noqa: E501 - """Your GET endpoint # noqa: E501 - get annotations for an available studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def annotations_get( + self, + studyset_id: Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationList: + """Your GET endpoint - >>> thread = api.annotations_get(studyset_id, async_req=True) - >>> result = thread.get() + get annotations for an available studyset :param studyset_id: see all annotations connected to this studyset :type studyset_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_get_with_http_info(studyset_id, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_get_with_http_info(self, studyset_id : Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 - - get annotations for an available studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.annotations_get_with_http_info(studyset_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_get_serialize( + studyset_id=studyset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_get_with_http_info( + self, + studyset_id: Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationList]: + """Your GET endpoint + + get annotations for an available studyset :param studyset_id: see all annotations connected to this studyset :type studyset_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_get_serialize( + studyset_id=studyset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'studyset_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotations_get_without_preload_content( + self, + studyset_id: Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + get annotations for an available studyset + + :param studyset_id: see all annotations connected to this studyset + :type studyset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_get_serialize( + studyset_id=studyset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotations_get_serialize( + self, + studyset_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('studyset_id') is not None: # noqa: E501 - _query_params.append(('studyset_id', _params['studyset_id'])) + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if studyset_id is not None: + + _query_params.append(('studyset_id', studyset_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotations/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotations/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def annotations_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE an annotation # noqa: E501 - delete annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def annotations_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE an annotation + + delete annotation :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE an annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE an annotation - >>> thread = api.annotations_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete annotation :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._annotations_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotations_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE an annotation + + delete annotation + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotations_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/annotations/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/annotations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def annotations_id_get(self, id : StrictStr, export : Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - get an individual annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def annotations_id_get( + self, + id: StrictStr, + export: Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationReturn: + """Your GET endpoint - >>> thread = api.annotations_id_get(id, export, async_req=True) - >>> result = thread.get() + get an individual annotation :param id: (required) :type id: str :param export: return endpoint data in consumable/readable format :type export: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_id_get_with_http_info(id, export, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_get_with_http_info(self, id : StrictStr, export : Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + export=export, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - get an individual annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_id_get_with_http_info( + self, + id: StrictStr, + export: Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationReturn]: + """Your GET endpoint - >>> thread = api.annotations_id_get_with_http_info(id, export, async_req=True) - >>> result = thread.get() + get an individual annotation :param id: (required) :type id: str :param export: return endpoint data in consumable/readable format :type export: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + export=export, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'export' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotations_id_get_without_preload_content( + self, + id: StrictStr, + export: Annotated[Optional[StrictBool], Field(description="return endpoint data in consumable/readable format")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + get an individual annotation + + :param id: (required) + :type id: str + :param export: return endpoint data in consumable/readable format + :type export: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + export=export, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotations_id_get_serialize( + self, + id, + export, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('export') is not None: # noqa: E501 - _query_params.append(('export', _params['export'])) + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if export is not None: + + _query_params.append(('export', export)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/annotations/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/annotations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotations_id_put(self, id : StrictStr, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Update an annotation # noqa: E501 - edit an existing annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_id_put(id, annotation_request, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_id_put( + self, + id: StrictStr, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationReturn: + """Update an annotation + + edit an existing annotation :param id: (required) :type id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_id_put_with_http_info(id, annotation_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_put_with_http_info(self, id : StrictStr, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - edit an existing annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_id_put_with_http_info( + self, + id: StrictStr, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationReturn]: + """Update an annotation - >>> thread = api.annotations_id_put_with_http_info(id, annotation_request, async_req=True) - >>> result = thread.get() + edit an existing annotation :param id: (required) :type id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'annotation_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotations_id_put_without_preload_content( + self, + id: StrictStr, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an annotation + + edit an existing annotation + + :param id: (required) + :type id: str + :param annotation_request: + :type annotation_request: AnnotationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _annotations_id_put_serialize( + self, + id, + annotation_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['annotation_request'] is not None: - _body_params = _params['annotation_request'] + if annotation_request is not None: + _body_params = annotation_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnnotationReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotations/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/annotations/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def annotations_post(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Post Annotation # noqa: E501 - Create an annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.annotations_post(source, source_id, annotation_request, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_post( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnnotationReturn: + """Post Annotation + + Create an annotation :param source: the source of the resource you would like to filter/copy from :type source: str @@ -2005,32 +3723,74 @@ def annotations_post(self, source : Annotated[Optional[StrictStr], Field(descrip :type source_id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: AnnotationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the annotations_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.annotations_post_with_http_info(source, source_id, annotation_request, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_post_with_http_info(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, annotation_request : Optional[AnnotationRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Post Annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_post_serialize( + source=source, + source_id=source_id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Create an annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def annotations_post_with_http_info( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnnotationReturn]: + """Post Annotation - >>> thread = api.annotations_post_with_http_info(source, source_id, annotation_request, async_req=True) - >>> result = thread.get() + Create an annotation :param source: the source of the resource you would like to filter/copy from :type source: str @@ -2038,129 +3798,245 @@ def annotations_post_with_http_info(self, source : Annotated[Optional[StrictStr] :type source_id: str :param annotation_request: :type annotation_request: AnnotationRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_post_serialize( + source=source, + source_id=source_id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'source', - 'source_id', - 'annotation_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def annotations_post_without_preload_content( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + annotation_request: Optional[AnnotationRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Post Annotation + + Create an annotation + + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param annotation_request: + :type annotation_request: AnnotationRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._annotations_post_serialize( + source=source, + source_id=source_id, + annotation_request=annotation_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method annotations_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _annotations_post_serialize( + self, + source, + source_id, + annotation_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if source is not None: + + _query_params.append(('source', source)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['annotation_request'] is not None: - _body_params = _params['annotation_request'] + if annotation_request is not None: + _body_params = annotation_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "AnnotationReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/annotations/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/annotations/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def base_studies_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, publication : Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> BaseStudyList: # noqa: E501 - """ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.base_studies_get(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, async_req=True) - >>> result = thread.get() - :param search: search for entries that contain the substring + @validate_call + def base_studies_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + publication: Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudyList: + """ + + + :param search: search for entries that contain the substring :type search: str :param sort: Parameter to sort results on :type sort: str @@ -2190,31 +4066,97 @@ def base_studies_get(self, search : Annotated[Optional[constr(strict=True, min_l :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_get_with_http_info(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, publication : Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + authors=authors, + level=level, + data_type=data_type, + publication=publication, + pmid=pmid, + doi=doi, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + publication: Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudyList]: + """ - >>> thread = api.base_studies_get_with_http_info(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, async_req=True) - >>> result = thread.get() :param search: search for entries that contain the substring :type search: str @@ -2246,168 +4188,339 @@ def base_studies_get_with_http_info(self, search : Annotated[Optional[constr(str :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description', - 'authors', - 'level', - 'data_type', - 'publication', - 'pmid', - 'doi', - 'flat', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._base_studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + authors=authors, + level=level, + data_type=data_type, + publication=publication, + pmid=pmid, + doi=doi, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) - - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) - - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - - if _params.get('authors') is not None: # noqa: E501 - _query_params.append(('authors', _params['authors'])) - - if _params.get('level') is not None: # noqa: E501 - _query_params.append(('level', _params['level'].value)) + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('data_type') is not None: # noqa: E501 - _query_params.append(('data_type', _params['data_type'].value)) - if _params.get('publication') is not None: # noqa: E501 - _query_params.append(('publication', _params['publication'])) + @validate_call + def base_studies_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + publication: Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ - if _params.get('pmid') is not None: # noqa: E501 - _query_params.append(('pmid', _params['pmid'])) - if _params.get('doi') is not None: # noqa: E501 - _query_params.append(('doi', _params['doi'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param authors: search authors + :type authors: str + :param level: select between studies with group results or meta results + :type level: str + :param data_type: whether searching for studies that contain coordinates, images, or both + :type data_type: str + :param publication: search for papers from a particular journal + :type publication: str + :param pmid: search for particular pmid + :type pmid: str + :param doi: search for study with specific doi + :type doi: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested + :type info: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + authors=authors, + level=level, + data_type=data_type, + publication=publication, + pmid=pmid, + doi=doi, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _base_studies_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + name, + description, + authors, + level, + data_type, + publication, + pmid, + doi, + flat, + info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if authors is not None: + + _query_params.append(('authors', authors)) + + if level is not None: + + _query_params.append(('level', level)) + + if data_type is not None: + + _query_params.append(('data_type', data_type)) + + if publication is not None: + + _query_params.append(('publication', publication)) + + if pmid is not None: + + _query_params.append(('pmid', pmid)) + + if doi is not None: + + _query_params.append(('doi', doi)) + + if flat is not None: + + _query_params.append(('flat', flat)) + + if info is not None: + + _query_params.append(('info', info)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "BaseStudyList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/base-studies/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/base-studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def base_studies_id_get(self, id : StrictStr, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> BaseStudyReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def base_studies_id_get( + self, + id: StrictStr, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudyReturn: + """Your GET endpoint - >>> thread = api.base_studies_id_get(id, flat, info, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str @@ -2415,31 +4528,73 @@ def base_studies_id_get(self, id : StrictStr, flat : Annotated[Optional[StrictBo :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_id_get_with_http_info(id, flat, info, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_id_get_with_http_info(self, id : StrictStr, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_id_get_serialize( + id=id, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_id_get_with_http_info( + self, + id: StrictStr, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudyReturn]: + """Your GET endpoint - >>> thread = api.base_studies_id_get_with_http_info(id, flat, info, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str @@ -2447,417 +4602,778 @@ def base_studies_id_get_with_http_info(self, id : StrictStr, flat : Annotated[Op :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._base_studies_id_get_serialize( + id=id, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'flat', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def base_studies_id_get_without_preload_content( + self, + id: StrictStr, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + + :param id: (required) + :type id: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested + :type info: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_id_get_serialize( + id=id, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _base_studies_id_get_serialize( + self, + id, + flat, + info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if flat is not None: + + _query_params.append(('flat', flat)) + + if info is not None: + + _query_params.append(('info', info)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "BaseStudyReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/base-studies/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/base-studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def base_studies_id_put(self, id : StrictStr, base_study : Optional[BaseStudy] = None, **kwargs) -> BaseStudyReturn: # noqa: E501 - """ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.base_studies_id_put(id, base_study, async_req=True) - >>> result = thread.get() + @validate_call + def base_studies_id_put( + self, + id: StrictStr, + base_study: Optional[BaseStudy] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudyReturn: + """ + :param id: (required) :type id: str :param base_study: :type base_study: BaseStudy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_id_put_with_http_info(id, base_study, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_id_put_with_http_info(self, id : StrictStr, base_study : Optional[BaseStudy] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_id_put_serialize( + id=id, + base_study=base_study, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_id_put_with_http_info( + self, + id: StrictStr, + base_study: Optional[BaseStudy] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudyReturn]: + """ - >>> thread = api.base_studies_id_put_with_http_info(id, base_study, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param base_study: :type base_study: BaseStudy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._base_studies_id_put_serialize( + id=id, + base_study=base_study, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'base_study' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def base_studies_id_put_without_preload_content( + self, + id: StrictStr, + base_study: Optional[BaseStudy] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ + + + :param id: (required) + :type id: str + :param base_study: + :type base_study: BaseStudy + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_id_put_serialize( + id=id, + base_study=base_study, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _base_studies_id_put_serialize( + self, + id, + base_study, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['base_study'] is not None: - _body_params = _params['base_study'] + if base_study is not None: + _body_params = base_study + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "BaseStudyReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/base-studies/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/base-studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def base_studies_post(self, base_studies_post_request : Optional[BaseStudiesPostRequest] = None, **kwargs) -> BaseStudiesPost200Response: # noqa: E501 - """ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.base_studies_post(base_studies_post_request, async_req=True) - >>> result = thread.get() + + @validate_call + def base_studies_post( + self, + base_studies_post_request: Optional[BaseStudiesPostRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudiesPost200Response: + """ + :param base_studies_post_request: :type base_studies_post_request: BaseStudiesPostRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudiesPost200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_post_with_http_info(base_studies_post_request, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_post_with_http_info(self, base_studies_post_request : Optional[BaseStudiesPostRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_post_serialize( + base_studies_post_request=base_studies_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudiesPost200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_post_with_http_info( + self, + base_studies_post_request: Optional[BaseStudiesPostRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudiesPost200Response]: + """ - >>> thread = api.base_studies_post_with_http_info(base_studies_post_request, async_req=True) - >>> result = thread.get() :param base_studies_post_request: :type base_studies_post_request: BaseStudiesPostRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudiesPost200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._base_studies_post_serialize( + base_studies_post_request=base_studies_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudiesPost200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'base_studies_post_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def base_studies_post_without_preload_content( + self, + base_studies_post_request: Optional[BaseStudiesPostRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ + + + :param base_studies_post_request: + :type base_studies_post_request: BaseStudiesPostRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_post_serialize( + base_studies_post_request=base_studies_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudiesPost200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _base_studies_post_serialize( + self, + base_studies_post_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['base_studies_post_request'] is not None: - _body_params = _params['base_studies_post_request'] + if base_studies_post_request is not None: + _body_params = base_studies_post_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "BaseStudiesPost200Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/base-studies/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/base-studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def conditions_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, **kwargs) -> ConditionList: # noqa: E501 - """GET Conditions # noqa: E501 - Get all conditions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def conditions_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionList: + """GET Conditions - >>> thread = api.conditions_get(search, sort, page, desc, page_size, name, description, async_req=True) - >>> result = thread.get() + Get all conditions :param search: search for entries that contain the substring :type search: str @@ -2873,32 +5389,82 @@ def conditions_get(self, search : Annotated[Optional[constr(strict=True, min_len :type name: str :param description: search description field for a term :type description: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_get_with_http_info(search, sort, page, desc, page_size, name, description, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET Conditions # noqa: E501 + """ # noqa: E501 + + _param = self._conditions_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Get all conditions # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionList]: + """GET Conditions - >>> thread = api.conditions_get_with_http_info(search, sort, page, desc, page_size, name, description, async_req=True) - >>> result = thread.get() + Get all conditions :param search: search for entries that contain the substring :type search: str @@ -2914,711 +5480,1349 @@ def conditions_get_with_http_info(self, search : Annotated[Optional[constr(stric :type name: str :param description: search description field for a term :type description: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._conditions_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + @validate_call + def conditions_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET Conditions - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + Get all conditions - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _conditions_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + name, + description, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ConditionList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/conditions/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/conditions/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a condition # noqa: E501 - delete a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a condition + + delete a condition :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a condition # noqa: E501 + """ # noqa: E501 + + _param = self._conditions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a condition - >>> thread = api.conditions_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete a condition :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._conditions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def conditions_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a condition + + delete a condition + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _conditions_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/conditions/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/conditions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def conditions_id_get(self, id : StrictStr, **kwargs) -> ConditionReturn: # noqa: E501 - """GET a condition # noqa: E501 - Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def conditions_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionReturn: + """GET a condition + + Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET a condition # noqa: E501 + """ # noqa: E501 + + _param = self._conditions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionReturn]: + """GET a condition - >>> thread = api.conditions_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._conditions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def conditions_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a condition + + Retrieve a condition (e.g., 2-back) that can be used in contrasts (e.g., 2-back - 1-back) + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _conditions_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ConditionReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/conditions/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/conditions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_id_put(self, id : StrictStr, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ConditionReturn: # noqa: E501 - """PUT/update a condition # noqa: E501 - update a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_id_put(id, condition_request, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_id_put( + self, + id: StrictStr, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionReturn: + """PUT/update a condition + + update a condition :param id: (required) :type id: str :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_id_put_with_http_info(id, condition_request, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_id_put_with_http_info(self, id : StrictStr, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a condition # noqa: E501 + """ # noqa: E501 + + _param = self._conditions_id_put_serialize( + id=id, + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_id_put_with_http_info( + self, + id: StrictStr, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionReturn]: + """PUT/update a condition - >>> thread = api.conditions_id_put_with_http_info(id, condition_request, async_req=True) - >>> result = thread.get() + update a condition :param id: (required) :type id: str :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._conditions_id_put_serialize( + id=id, + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'condition_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def conditions_id_put_without_preload_content( + self, + id: StrictStr, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a condition + + update a condition + + :param id: (required) + :type id: str + :param condition_request: + :type condition_request: ConditionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_id_put_serialize( + id=id, + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _conditions_id_put_serialize( + self, + id, + condition_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['condition_request'] is not None: - _body_params = _params['condition_request'] + if condition_request is not None: + _body_params = condition_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ConditionReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/conditions/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/conditions/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def conditions_post(self, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ConditionReturn: # noqa: E501 - """POST/Create a condition # noqa: E501 - Create a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.conditions_post(condition_request, async_req=True) - >>> result = thread.get() + @validate_call + def conditions_post( + self, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ConditionReturn: + """POST/Create a condition + + Create a condition :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ConditionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the conditions_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.conditions_post_with_http_info(condition_request, **kwargs) # noqa: E501 - - @validate_arguments - def conditions_post_with_http_info(self, condition_request : Optional[ConditionRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/Create a condition # noqa: E501 + """ # noqa: E501 + + _param = self._conditions_post_serialize( + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Create a condition # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def conditions_post_with_http_info( + self, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ConditionReturn]: + """POST/Create a condition - >>> thread = api.conditions_post_with_http_info(condition_request, async_req=True) - >>> result = thread.get() + Create a condition :param condition_request: :type condition_request: ConditionRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ConditionReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._conditions_post_serialize( + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'condition_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method conditions_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def conditions_post_without_preload_content( + self, + condition_request: Optional[ConditionRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/Create a condition - # process the path parameters - _path_params = {} + Create a condition + + :param condition_request: + :type condition_request: ConditionRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._conditions_post_serialize( + condition_request=condition_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ConditionReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _conditions_post_serialize( + self, + condition_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if condition_request is not None: + _body_params = condition_request - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['condition_request'] is not None: - _body_params = _params['condition_request'] # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ConditionReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/conditions/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/conditions/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def images_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, filename : Annotated[Optional[StrictStr], Field(description="search filename field")] = None, analysis_name : Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, value_type : Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, space : Annotated[Optional[StrictStr], Field(description="search space field")] = None, **kwargs) -> ImageList: # noqa: E501 - """GET a list of images # noqa: E501 - Retrieve and list images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def images_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + filename: Annotated[Optional[StrictStr], Field(description="search filename field")] = None, + analysis_name: Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, + value_type: Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, + space: Annotated[Optional[StrictStr], Field(description="search space field")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageList: + """GET a list of images - >>> thread = api.images_get(search, sort, page, desc, page_size, filename, analysis_name, value_type, space, async_req=True) - >>> result = thread.get() + Retrieve and list images. :param search: search for entries that contain the substring :type search: str @@ -3638,32 +6842,86 @@ def images_get(self, search : Annotated[Optional[constr(strict=True, min_length= :type value_type: str :param space: search space field :type space: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_get_with_http_info(search, sort, page, desc, page_size, filename, analysis_name, value_type, space, **kwargs) # noqa: E501 - - @validate_arguments - def images_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, filename : Annotated[Optional[StrictStr], Field(description="search filename field")] = None, analysis_name : Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, value_type : Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, space : Annotated[Optional[StrictStr], Field(description="search space field")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of images # noqa: E501 + """ # noqa: E501 + + _param = self._images_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + filename=filename, + analysis_name=analysis_name, + value_type=value_type, + space=space, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Retrieve and list images. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + filename: Annotated[Optional[StrictStr], Field(description="search filename field")] = None, + analysis_name: Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, + value_type: Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, + space: Annotated[Optional[StrictStr], Field(description="search space field")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageList]: + """GET a list of images - >>> thread = api.images_get_with_http_info(search, sort, page, desc, page_size, filename, analysis_name, value_type, space, async_req=True) - >>> result = thread.get() + Retrieve and list images. :param search: search for entries that contain the substring :type search: str @@ -3683,1424 +6941,2846 @@ def images_get_with_http_info(self, search : Annotated[Optional[constr(strict=Tr :type value_type: str :param space: search space field :type space: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'filename', - 'analysis_name', - 'value_type', - 'space' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._images_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + filename=filename, + analysis_name=analysis_name, + value_type=value_type, + space=space, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + @validate_call + def images_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + filename: Annotated[Optional[StrictStr], Field(description="search filename field")] = None, + analysis_name: Annotated[Optional[StrictStr], Field(description="search analysis_name field")] = None, + value_type: Annotated[Optional[StrictStr], Field(description="search value_type field")] = None, + space: Annotated[Optional[StrictStr], Field(description="search space field")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of images - if _params.get('filename') is not None: # noqa: E501 - _query_params.append(('filename', _params['filename'])) + Retrieve and list images. - if _params.get('analysis_name') is not None: # noqa: E501 - _query_params.append(('analysis_name', _params['analysis_name'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param filename: search filename field + :type filename: str + :param analysis_name: search analysis_name field + :type analysis_name: str + :param value_type: search value_type field + :type value_type: str + :param space: search space field + :type space: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + filename=filename, + analysis_name=analysis_name, + value_type=value_type, + space=space, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('value_type') is not None: # noqa: E501 - _query_params.append(('value_type', _params['value_type'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _images_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + filename, + analysis_name, + value_type, + space, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('space') is not None: # noqa: E501 - _query_params.append(('space', _params['space'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if filename is not None: + + _query_params.append(('filename', filename)) + + if analysis_name is not None: + + _query_params.append(('analysis_name', analysis_name)) + + if value_type is not None: + + _query_params.append(('value_type', value_type)) + + if space is not None: + + _query_params.append(('space', space)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ImageList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/images/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/images/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def images_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE an image # noqa: E501 - delete an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def images_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE an image - >>> thread = api.images_id_delete(id, async_req=True) - >>> result = thread.get() + delete an image :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def images_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE an image # noqa: E501 + """ # noqa: E501 + + _param = self._images_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE an image - >>> thread = api.images_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete an image :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._images_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE an image + + delete an image + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _images_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/images/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/images/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def images_id_get(self, id : StrictStr, **kwargs) -> ImageReturn: # noqa: E501 - """GET an image # noqa: E501 - Retrieve information about a particular image from an analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.images_id_get(id, async_req=True) - >>> result = thread.get() + @validate_call + def images_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageReturn: + """GET an image + + Retrieve information about a particular image from an analysis. :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def images_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET an image # noqa: E501 + """ # noqa: E501 + + _param = self._images_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Retrieve information about a particular image from an analysis. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageReturn]: + """GET an image - >>> thread = api.images_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + Retrieve information about a particular image from an analysis. :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._images_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET an image + + Retrieve information about a particular image from an analysis. + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _images_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "ImageReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/images/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/images/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def images_id_put(self, id : StrictStr, image_request : Optional[ImageRequest] = None, **kwargs) -> ImageReturn: # noqa: E501 - """PUT/update an image # noqa: E501 - Update a specific image. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.images_id_put(id, image_request, async_req=True) - >>> result = thread.get() + + @validate_call + def images_id_put( + self, + id: StrictStr, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageReturn: + """PUT/update an image + + Update a specific image. :param id: (required) :type id: str :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_id_put_with_http_info(id, image_request, **kwargs) # noqa: E501 - - @validate_arguments - def images_id_put_with_http_info(self, id : StrictStr, image_request : Optional[ImageRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update an image # noqa: E501 + """ # noqa: E501 + + _param = self._images_id_put_serialize( + id=id, + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Update a specific image. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_id_put_with_http_info( + self, + id: StrictStr, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageReturn]: + """PUT/update an image - >>> thread = api.images_id_put_with_http_info(id, image_request, async_req=True) - >>> result = thread.get() + Update a specific image. :param id: (required) :type id: str :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._images_id_put_serialize( + id=id, + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'image_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_id_put_without_preload_content( + self, + id: StrictStr, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update an image + + Update a specific image. + + :param id: (required) + :type id: str + :param image_request: + :type image_request: ImageRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_id_put_serialize( + id=id, + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _images_id_put_serialize( + self, + id, + image_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['image_request'] is not None: - _body_params = _params['image_request'] + if image_request is not None: + _body_params = image_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ImageReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/images/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/images/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def images_post(self, image_request : Optional[ImageRequest] = None, **kwargs) -> ImageReturn: # noqa: E501 - """POST/create an image # noqa: E501 - Create an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.images_post(image_request, async_req=True) - >>> result = thread.get() + @validate_call + def images_post( + self, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ImageReturn: + """POST/create an image + + Create an image :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ImageReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the images_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.images_post_with_http_info(image_request, **kwargs) # noqa: E501 - - @validate_arguments - def images_post_with_http_info(self, image_request : Optional[ImageRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create an image # noqa: E501 + """ # noqa: E501 + + _param = self._images_post_serialize( + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Create an image # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def images_post_with_http_info( + self, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ImageReturn]: + """POST/create an image - >>> thread = api.images_post_with_http_info(image_request, async_req=True) - >>> result = thread.get() + Create an image :param image_request: :type image_request: ImageRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ImageReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._images_post_serialize( + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'image_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def images_post_without_preload_content( + self, + image_request: Optional[ImageRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create an image + + Create an image + + :param image_request: + :type image_request: ImageRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._images_post_serialize( + image_request=image_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method images_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ImageReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _images_post_serialize( + self, + image_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['image_request'] is not None: - _body_params = _params['image_request'] + if image_request is not None: + _body_params = image_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ImageReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/images/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/images/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def points_get(self, **kwargs) -> PointList: # noqa: E501 - """Get Points # noqa: E501 - list points in database # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def points_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointList: + """Get Points - >>> thread = api.points_get(async_req=True) - >>> result = thread.get() + list points in database - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def points_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get Points # noqa: E501 - - list points in database # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.points_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._points_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointList]: + """Get Points + + list points in database + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._points_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def points_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Points + + list points in database + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _points_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "PointList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/points/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/points/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def points_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a point # noqa: E501 - delete a point # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.points_id_delete(id, async_req=True) - >>> result = thread.get() + + @validate_call + def points_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a point + + delete a point :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def points_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a point # noqa: E501 + """ # noqa: E501 + + _param = self._points_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete a point # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a point - >>> thread = api.points_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete a point :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._points_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def points_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a point + + delete a point + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _points_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/points/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/points/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def points_id_get(self, id : StrictStr, **kwargs) -> PointReturn: # noqa: E501 - """GET a point # noqa: E501 - Information about a particular MRI coordinate # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def points_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointReturn: + """GET a point - >>> thread = api.points_id_get(id, async_req=True) - >>> result = thread.get() + Information about a particular MRI coordinate :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def points_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET a point # noqa: E501 + """ # noqa: E501 + + _param = self._points_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Information about a particular MRI coordinate # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointReturn]: + """GET a point - >>> thread = api.points_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + Information about a particular MRI coordinate :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._points_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def points_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a point + + Information about a particular MRI coordinate + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _points_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "PointReturn", - '404': None, - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/points/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/points/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def points_id_put(self, id : StrictStr, point_request : Optional[PointRequest] = None, **kwargs) -> PointReturn: # noqa: E501 - """PUT/update a point # noqa: E501 - Update a particular MRI coordinate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.points_id_put(id, point_request, async_req=True) - >>> result = thread.get() + + @validate_call + def points_id_put( + self, + id: StrictStr, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointReturn: + """PUT/update a point + + Update a particular MRI coordinate. :param id: (required) :type id: str :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_id_put_with_http_info(id, point_request, **kwargs) # noqa: E501 - - @validate_arguments - def points_id_put_with_http_info(self, id : StrictStr, point_request : Optional[PointRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a point # noqa: E501 + """ # noqa: E501 + + _param = self._points_id_put_serialize( + id=id, + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Update a particular MRI coordinate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_id_put_with_http_info( + self, + id: StrictStr, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointReturn]: + """PUT/update a point - >>> thread = api.points_id_put_with_http_info(id, point_request, async_req=True) - >>> result = thread.get() + Update a particular MRI coordinate. :param id: (required) :type id: str :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._points_id_put_serialize( + id=id, + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'point_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def points_id_put_without_preload_content( + self, + id: StrictStr, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a point + + Update a particular MRI coordinate. + + :param id: (required) + :type id: str + :param point_request: + :type point_request: PointRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_id_put_serialize( + id=id, + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _points_id_put_serialize( + self, + id, + point_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['point_request'] is not None: - _body_params = _params['point_request'] + if point_request is not None: + _body_params = point_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "PointReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/points/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/points/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def points_post(self, point_request : Optional[PointRequest] = None, **kwargs) -> PointReturn: # noqa: E501 - """POST Points # noqa: E501 - add a point to an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.points_post(point_request, async_req=True) - >>> result = thread.get() + @validate_call + def points_post( + self, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PointReturn: + """POST Points + + add a point to an analysis :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PointReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the points_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.points_post_with_http_info(point_request, **kwargs) # noqa: E501 - - @validate_arguments - def points_post_with_http_info(self, point_request : Optional[PointRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST Points # noqa: E501 + """ # noqa: E501 + + _param = self._points_post_serialize( + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - add a point to an analysis # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def points_post_with_http_info( + self, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PointReturn]: + """POST Points - >>> thread = api.points_post_with_http_info(point_request, async_req=True) - >>> result = thread.get() + add a point to an analysis :param point_request: :type point_request: PointRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PointReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._points_post_serialize( + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'point_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def points_post_without_preload_content( + self, + point_request: Optional[PointRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST Points + + add a point to an analysis + + :param point_request: + :type point_request: PointRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._points_post_serialize( + point_request=point_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method points_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "PointReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _points_post_serialize( + self, + point_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['point_request'] is not None: - _body_params = _params['point_request'] + if point_request is not None: + _body_params = point_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/points/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def studies_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyList: + """GET a list of studies + + List studies + + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param unique: whether to list clones with originals + :type unique: object + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param authors: search authors + :type authors: str + :param user_id: user id you want to filter by + :type user_id: str + :param data_type: whether searching for studies that contain coordinates, images, or both + :type data_type: str + :param studyset_owner: for all studies filter which studysets are listed based on who owns the studyset + :type studyset_owner: str + :param level: select between studies with group results or meta results + :type level: str + :param pmid: search for particular pmid + :type pmid: str + :param doi: search for study with specific doi + :type doi: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + data_type=data_type, + studyset_owner=studyset_owner, + level=level, + pmid=pmid, + doi=doi, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _response_types_map = { - '200': "PointReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyList", } - - return self.api_client.call_api( - '/points/', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def studies_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, unique : Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> StudyList: # noqa: E501 - """GET a list of studies # noqa: E501 - - List studies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def studies_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyList]: + """GET a list of studies - >>> thread = api.studies_get(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, data_type, studyset_owner, level, pmid, doi, flat, async_req=True) - >>> result = thread.get() + List studies :param search: search for entries that contain the substring :type search: str @@ -5140,32 +9820,106 @@ def studies_get(self, search : Annotated[Optional[constr(strict=True, min_length :type doi: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_get_with_http_info(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, data_type, studyset_owner, level, pmid, doi, flat, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + data_type=data_type, + studyset_owner=studyset_owner, + level=level, + pmid=pmid, + doi=doi, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, unique : Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of studies # noqa: E501 - List studies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def studies_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of studies - >>> thread = api.studies_get_with_http_info(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, data_type, studyset_owner, level, pmid, doi, flat, async_req=True) - >>> result = thread.get() + List studies :param search: search for entries that contain the substring :type search: str @@ -5205,318 +9959,497 @@ def studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=T :type doi: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'nested', - 'name', - 'description', - 'source_id', - 'unique', - 'source', - 'authors', - 'user_id', - 'data_type', - 'studyset_owner', - 'level', - 'pmid', - 'doi', - 'flat' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + data_type=data_type, + studyset_owner=studyset_owner, + level=level, + pmid=pmid, + doi=doi, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _studies_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + nested, + name, + description, + source_id, + unique, + source, + authors, + user_id, + data_type, + studyset_owner, + level, + pmid, + doi, + flat, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - _collection_formats = {} + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) - - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) - - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) - - if _params.get('unique') is not None: # noqa: E501 - _query_params.append(('unique', _params['unique'])) - - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) - - if _params.get('authors') is not None: # noqa: E501 - _query_params.append(('authors', _params['authors'])) - - if _params.get('user_id') is not None: # noqa: E501 - _query_params.append(('user_id', _params['user_id'])) - - if _params.get('data_type') is not None: # noqa: E501 - _query_params.append(('data_type', _params['data_type'].value)) - - if _params.get('studyset_owner') is not None: # noqa: E501 - _query_params.append(('studyset_owner', _params['studyset_owner'])) - - if _params.get('level') is not None: # noqa: E501 - _query_params.append(('level', _params['level'].value)) - - if _params.get('pmid') is not None: # noqa: E501 - _query_params.append(('pmid', _params['pmid'])) - - if _params.get('doi') is not None: # noqa: E501 - _query_params.append(('doi', _params['doi'])) - - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) - + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if nested is not None: + + _query_params.append(('nested', nested)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + + if unique is not None: + + _query_params.append(('unique', unique)) + + if source is not None: + + _query_params.append(('source', source)) + + if authors is not None: + + _query_params.append(('authors', authors)) + + if user_id is not None: + + _query_params.append(('user_id', user_id)) + + if data_type is not None: + + _query_params.append(('data_type', data_type)) + + if studyset_owner is not None: + + _query_params.append(('studyset_owner', studyset_owner)) + + if level is not None: + + _query_params.append(('level', level)) + + if pmid is not None: + + _query_params.append(('pmid', pmid)) + + if doi is not None: + + _query_params.append(('doi', doi)) + + if flat is not None: + + _query_params.append(('flat', flat)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "StudyList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studies/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studies_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a study # noqa: E501 - delete a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def studies_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a study + + delete a study :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def studies_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a study - >>> thread = api.studies_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete a study :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._studies_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studies_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a study + + delete a study + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studies_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/studies/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def studies_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> StudyReturn: # noqa: E501 - """GET a study # noqa: E501 - Get a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def studies_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyReturn: + """GET a study - >>> thread = api.studies_id_get(id, nested, studyset_owner, flat, async_req=True) - >>> result = thread.get() + Get a study. :param id: (required) :type id: str @@ -5526,32 +10459,77 @@ def studies_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool] :type studyset_owner: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_id_get_with_http_info(id, nested, studyset_owner, flat, **kwargs) # noqa: E501 - - @validate_arguments - def studies_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_id_get_serialize( + id=id, + nested=nested, + studyset_owner=studyset_owner, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Get a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyReturn]: + """GET a study - >>> thread = api.studies_id_get_with_http_info(id, nested, studyset_owner, flat, async_req=True) - >>> result = thread.get() + Get a study. :param id: (required) :type id: str @@ -5561,281 +10539,597 @@ def studies_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optio :type studyset_owner: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studies_id_get_serialize( + id=id, + nested=nested, + studyset_owner=studyset_owner, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'nested', - 'studyset_owner', - 'flat' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studies_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] - ) + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a study - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + Get a study. + + :param id: (required) + :type id: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param studyset_owner: for all studies filter which studysets are listed based on who owns the studyset + :type studyset_owner: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_id_get_serialize( + id=id, + nested=nested, + studyset_owner=studyset_owner, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studies_id_get_serialize( + self, + id, + nested, + studyset_owner, + flat, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _host = None - if _params.get('studyset_owner') is not None: # noqa: E501 - _query_params.append(('studyset_owner', _params['studyset_owner'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if nested is not None: + + _query_params.append(('nested', nested)) + + if studyset_owner is not None: + + _query_params.append(('studyset_owner', studyset_owner)) + + if flat is not None: + + _query_params.append(('flat', flat)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudyReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/studies/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def studies_id_put(self, id : StrictStr, study_request : Optional[StudyRequest] = None, **kwargs) -> StudyReturn: # noqa: E501 - """PUT/update a study # noqa: E501 - Update a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_id_put(id, study_request, async_req=True) - >>> result = thread.get() + + @validate_call + def studies_id_put( + self, + id: StrictStr, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyReturn: + """PUT/update a study + + Update a study. :param id: (required) :type id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_id_put_with_http_info(id, study_request, **kwargs) # noqa: E501 - - @validate_arguments - def studies_id_put_with_http_info(self, id : StrictStr, study_request : Optional[StudyRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_id_put_serialize( + id=id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Update a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_id_put_with_http_info( + self, + id: StrictStr, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyReturn]: + """PUT/update a study - >>> thread = api.studies_id_put_with_http_info(id, study_request, async_req=True) - >>> result = thread.get() + Update a study. :param id: (required) :type id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studies_id_put_serialize( + id=id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'study_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def studies_id_put_without_preload_content( + self, + id: StrictStr, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a study + + Update a study. + + :param id: (required) + :type id: str + :param study_request: + :type study_request: StudyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_id_put_serialize( + id=id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studies_id_put_serialize( + self, + id, + study_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['study_request'] is not None: - _body_params = _params['study_request'] + if study_request is not None: + _body_params = study_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudyReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studies/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def studies_post(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, study_request : Optional[StudyRequest] = None, **kwargs) -> StudyReturn: # noqa: E501 - """POST/create a study # noqa: E501 - Create a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_post(source, source_id, study_request, async_req=True) - >>> result = thread.get() + + @validate_call + def studies_post( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyReturn: + """POST/create a study + + Create a study + + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param study_request: + :type study_request: StudyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_post_serialize( + source=source, + source_id=source_id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_post_with_http_info( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyReturn]: + """POST/create a study + + Create a study :param source: the source of the resource you would like to filter/copy from :type source: str @@ -5843,32 +11137,74 @@ def studies_post(self, source : Annotated[Optional[StrictStr], Field(description :type source_id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_post_with_http_info(source, source_id, study_request, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._studies_post_serialize( + source=source, + source_id=source_id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - @validate_arguments - def studies_post_with_http_info(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, study_request : Optional[StudyRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create a study # noqa: E501 - Create a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def studies_post_without_preload_content( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a study - >>> thread = api.studies_post_with_http_info(source, source_id, study_request, async_req=True) - >>> result = thread.get() + Create a study :param source: the source of the resource you would like to filter/copy from :type source: str @@ -5876,261 +11212,411 @@ def studies_post_with_http_info(self, source : Annotated[Optional[StrictStr], Fi :type source_id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._studies_post_serialize( + source=source, + source_id=source_id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'source', - 'source_id', - 'study_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studies_post_serialize( + self, + source, + source_id, + study_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None - # process the query parameters - _query_params = [] - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) + _collection_formats: Dict[str, str] = { + } - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if source is not None: + + _query_params.append(('source', source)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['study_request'] is not None: - _body_params = _params['study_request'] + if study_request is not None: + _body_params = study_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudyReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studies/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studysets_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a studyset # noqa: E501 - delete a studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a studyset + + delete a studyset :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete a studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a studyset - >>> thread = api.studysets_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete a studyset :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._studysets_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studysets_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a studyset + + delete a studyset + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studysets_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/studysets/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/studysets/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def studysets_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, gzip : Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """GET a studyset # noqa: E501 - Retrieve the information of a studyset with the matching studyset ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_id_get(id, nested, gzip, async_req=True) - >>> result = thread.get() + + @validate_call + def studysets_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + gzip: Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetReturn: + """GET a studyset + + Retrieve the information of a studyset with the matching studyset ID. :param id: (required) :type id: str @@ -6138,32 +11624,75 @@ def studysets_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBoo :type nested: bool :param gzip: return the content as gzipped content :type gzip: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_id_get_with_http_info(id, nested, gzip, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, gzip : Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + nested=nested, + gzip=gzip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Retrieve the information of a studyset with the matching studyset ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + gzip: Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetReturn]: + """GET a studyset - >>> thread = api.studysets_id_get_with_http_info(id, nested, gzip, async_req=True) - >>> result = thread.get() + Retrieve the information of a studyset with the matching studyset ID. :param id: (required) :type id: str @@ -6171,409 +11700,760 @@ def studysets_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Opt :type nested: bool :param gzip: return the content as gzipped content :type gzip: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + nested=nested, + gzip=gzip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'nested', - 'gzip' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def studysets_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + gzip: Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a studyset + + Retrieve the information of a studyset with the matching studyset ID. + + :param id: (required) + :type id: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param gzip: return the content as gzipped content + :type gzip: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + nested=nested, + gzip=gzip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studysets_id_get_serialize( + self, + id, + nested, + gzip, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('gzip') is not None: # noqa: E501 - _query_params.append(('gzip', _params['gzip'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if nested is not None: + + _query_params.append(('nested', nested)) + + if gzip is not None: + + _query_params.append(('gzip', gzip)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/gzip']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/gzip' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/studysets/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studysets/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studysets_id_put(self, id : StrictStr, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """PUT/update a studyset # noqa: E501 - Update a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_id_put(id, studyset_request, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_id_put( + self, + id: StrictStr, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetReturn: + """PUT/update a studyset + + Update a studyset. :param id: (required) :type id: str :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_id_put_with_http_info(id, studyset_request, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_put_with_http_info(self, id : StrictStr, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Update a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_id_put_with_http_info( + self, + id: StrictStr, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetReturn]: + """PUT/update a studyset - >>> thread = api.studysets_id_put_with_http_info(id, studyset_request, async_req=True) - >>> result = thread.get() + Update a studyset. :param id: (required) :type id: str :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'studyset_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studysets_id_put_without_preload_content( + self, + id: StrictStr, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a studyset + + Update a studyset. + + :param id: (required) + :type id: str + :param studyset_request: + :type studyset_request: StudysetRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studysets_id_put_serialize( + self, + id, + studyset_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['studyset_request'] is not None: - _body_params = _params['studyset_request'] + if studyset_request is not None: + _body_params = studyset_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudysetReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studysets/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/studysets/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studysets_post(self, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """POST/create a studyset # noqa: E501 - Create a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_post(studyset_request, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_post( + self, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetReturn: + """POST/create a studyset + + Create a studyset. :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_post_with_http_info(studyset_request, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_post_with_http_info(self, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create a studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Create a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_post_with_http_info( + self, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetReturn]: + """POST/create a studyset - >>> thread = api.studysets_post_with_http_info(studyset_request, async_req=True) - >>> result = thread.get() + Create a studyset. :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'studyset_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def studysets_post_without_preload_content( + self, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a studyset + + Create a studyset. + + :param studyset_request: + :type studyset_request: StudysetRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _studysets_post_serialize( + self, + studyset_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['studyset_request'] is not None: - _body_params = _params['studyset_request'] + if studyset_request is not None: + _body_params = studyset_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudysetReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studysets/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/studysets/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/studies_api.py b/neurostore_sdk/api/studies_api.py index ea6a1cb..fb40ce0 100644 --- a/neurostore_sdk/api/studies_api.py +++ b/neurostore_sdk/api/studies_api.py @@ -3,27 +3,23 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, constr - +from pydantic import Field, StrictBool, StrictStr, field_validator from typing import Any, Optional - +from typing_extensions import Annotated from neurostore_sdk.models.base_studies_post200_response import BaseStudiesPost200Response from neurostore_sdk.models.base_studies_post_request import BaseStudiesPostRequest from neurostore_sdk.models.base_study import BaseStudy @@ -33,35 +29,57 @@ from neurostore_sdk.models.study_request import StudyRequest from neurostore_sdk.models.study_return import StudyReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class StudiesApi(object): +class StudiesApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def base_studies_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, publication : Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> BaseStudyList: # noqa: E501 - """ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def base_studies_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + publication: Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudyList: + """ - >>> thread = api.base_studies_get(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, async_req=True) - >>> result = thread.get() :param search: search for entries that contain the substring :type search: str @@ -93,31 +111,97 @@ def base_studies_get(self, search : Annotated[Optional[constr(strict=True, min_l :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_get_with_http_info(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, publication : Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + authors=authors, + level=level, + data_type=data_type, + publication=publication, + pmid=pmid, + doi=doi, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + publication: Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudyList]: + """ - >>> thread = api.base_studies_get_with_http_info(search, sort, page, desc, page_size, name, description, authors, level, data_type, publication, pmid, doi, flat, info, async_req=True) - >>> result = thread.get() :param search: search for entries that contain the substring :type search: str @@ -149,168 +233,339 @@ def base_studies_get_with_http_info(self, search : Annotated[Optional[constr(str :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'name', - 'description', - 'authors', - 'level', - 'data_type', - 'publication', - 'pmid', - 'doi', - 'flat', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._base_studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + authors=authors, + level=level, + data_type=data_type, + publication=publication, + pmid=pmid, + doi=doi, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) - - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) - - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - - if _params.get('authors') is not None: # noqa: E501 - _query_params.append(('authors', _params['authors'])) - - if _params.get('level') is not None: # noqa: E501 - _query_params.append(('level', _params['level'].value)) + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('data_type') is not None: # noqa: E501 - _query_params.append(('data_type', _params['data_type'].value)) - if _params.get('publication') is not None: # noqa: E501 - _query_params.append(('publication', _params['publication'])) + @validate_call + def base_studies_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + publication: Annotated[Optional[StrictStr], Field(description="search for papers from a particular journal")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ - if _params.get('pmid') is not None: # noqa: E501 - _query_params.append(('pmid', _params['pmid'])) - if _params.get('doi') is not None: # noqa: E501 - _query_params.append(('doi', _params['doi'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param authors: search authors + :type authors: str + :param level: select between studies with group results or meta results + :type level: str + :param data_type: whether searching for studies that contain coordinates, images, or both + :type data_type: str + :param publication: search for papers from a particular journal + :type publication: str + :param pmid: search for particular pmid + :type pmid: str + :param doi: search for study with specific doi + :type doi: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested + :type info: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + name=name, + description=description, + authors=authors, + level=level, + data_type=data_type, + publication=publication, + pmid=pmid, + doi=doi, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _base_studies_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + name, + description, + authors, + level, + data_type, + publication, + pmid, + doi, + flat, + info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if authors is not None: + + _query_params.append(('authors', authors)) + + if level is not None: + + _query_params.append(('level', level)) + + if data_type is not None: + + _query_params.append(('data_type', data_type)) + + if publication is not None: + + _query_params.append(('publication', publication)) + + if pmid is not None: + + _query_params.append(('pmid', pmid)) + + if doi is not None: + + _query_params.append(('doi', doi)) + + if flat is not None: + + _query_params.append(('flat', flat)) + + if info is not None: + + _query_params.append(('info', info)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "BaseStudyList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/base-studies/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/base-studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def base_studies_id_get(self, id : StrictStr, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> BaseStudyReturn: # noqa: E501 - """Your GET endpoint # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.base_studies_id_get(id, flat, info, async_req=True) - >>> result = thread.get() + @validate_call + def base_studies_id_get( + self, + id: StrictStr, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudyReturn: + """Your GET endpoint + :param id: (required) :type id: str @@ -318,31 +573,73 @@ def base_studies_id_get(self, id : StrictStr, flat : Annotated[Optional[StrictBo :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_id_get_with_http_info(id, flat, info, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_id_get_with_http_info(self, id : StrictStr, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, info : Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_id_get_serialize( + id=id, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_id_get_with_http_info( + self, + id: StrictStr, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudyReturn]: + """Your GET endpoint - >>> thread = api.base_studies_id_get_with_http_info(id, flat, info, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str @@ -350,417 +647,790 @@ def base_studies_id_get_with_http_info(self, id : StrictStr, flat : Annotated[Op :type flat: bool :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._base_studies_id_get_serialize( + id=id, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'flat', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def base_studies_id_get_without_preload_content( + self, + id: StrictStr, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + info: Annotated[Optional[StrictBool], Field(description="show additional for endpoint-object relationships without being fully nested. Incompatible with nested")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + + :param id: (required) + :type id: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param info: show additional for endpoint-object relationships without being fully nested. Incompatible with nested + :type info: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_id_get_serialize( + id=id, + flat=flat, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _base_studies_id_get_serialize( + self, + id, + flat, + info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if flat is not None: + + _query_params.append(('flat', flat)) + + if info is not None: + + _query_params.append(('info', info)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "BaseStudyReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/base-studies/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/base-studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def base_studies_id_put(self, id : StrictStr, base_study : Optional[BaseStudy] = None, **kwargs) -> BaseStudyReturn: # noqa: E501 - """ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.base_studies_id_put(id, base_study, async_req=True) - >>> result = thread.get() + + @validate_call + def base_studies_id_put( + self, + id: StrictStr, + base_study: Optional[BaseStudy] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudyReturn: + """ + :param id: (required) :type id: str :param base_study: :type base_study: BaseStudy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_id_put_with_http_info(id, base_study, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_id_put_with_http_info(self, id : StrictStr, base_study : Optional[BaseStudy] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_id_put_serialize( + id=id, + base_study=base_study, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_id_put_with_http_info( + self, + id: StrictStr, + base_study: Optional[BaseStudy] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudyReturn]: + """ - >>> thread = api.base_studies_id_put_with_http_info(id, base_study, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param base_study: :type base_study: BaseStudy - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._base_studies_id_put_serialize( + id=id, + base_study=base_study, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'base_study' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def base_studies_id_put_without_preload_content( + self, + id: StrictStr, + base_study: Optional[BaseStudy] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ + + + :param id: (required) + :type id: str + :param base_study: + :type base_study: BaseStudy + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_id_put_serialize( + id=id, + base_study=base_study, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _base_studies_id_put_serialize( + self, + id, + base_study, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['base_study'] is not None: - _body_params = _params['base_study'] + if base_study is not None: + _body_params = base_study + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "BaseStudyReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/base-studies/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/base-studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def base_studies_post(self, base_studies_post_request : Optional[BaseStudiesPostRequest] = None, **kwargs) -> BaseStudiesPost200Response: # noqa: E501 - """ # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.base_studies_post(base_studies_post_request, async_req=True) - >>> result = thread.get() + @validate_call + def base_studies_post( + self, + base_studies_post_request: Optional[BaseStudiesPostRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BaseStudiesPost200Response: + """ + :param base_studies_post_request: :type base_studies_post_request: BaseStudiesPostRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: BaseStudiesPost200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the base_studies_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.base_studies_post_with_http_info(base_studies_post_request, **kwargs) # noqa: E501 - - @validate_arguments - def base_studies_post_with_http_info(self, base_studies_post_request : Optional[BaseStudiesPostRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._base_studies_post_serialize( + base_studies_post_request=base_studies_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudiesPost200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def base_studies_post_with_http_info( + self, + base_studies_post_request: Optional[BaseStudiesPostRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BaseStudiesPost200Response]: + """ - >>> thread = api.base_studies_post_with_http_info(base_studies_post_request, async_req=True) - >>> result = thread.get() :param base_studies_post_request: :type base_studies_post_request: BaseStudiesPostRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(BaseStudiesPost200Response, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._base_studies_post_serialize( + base_studies_post_request=base_studies_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudiesPost200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'base_studies_post_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def base_studies_post_without_preload_content( + self, + base_studies_post_request: Optional[BaseStudiesPostRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ + + + :param base_studies_post_request: + :type base_studies_post_request: BaseStudiesPostRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._base_studies_post_serialize( + base_studies_post_request=base_studies_post_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method base_studies_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "BaseStudiesPost200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _base_studies_post_serialize( + self, + base_studies_post_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['base_studies_post_request'] is not None: - _body_params = _params['base_studies_post_request'] + if base_studies_post_request is not None: + _body_params = base_studies_post_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - _response_types_map = { - '200': "BaseStudiesPost200Response", - } - - return self.api_client.call_api( - '/base-studies/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/base-studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def studies_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, unique : Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> StudyList: # noqa: E501 - """GET a list of studies # noqa: E501 - List studies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_get(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, data_type, studyset_owner, level, pmid, doi, flat, async_req=True) - >>> result = thread.get() + + @validate_call + def studies_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyList: + """GET a list of studies + + List studies :param search: search for entries that contain the substring :type search: str @@ -800,32 +1470,106 @@ def studies_get(self, search : Annotated[Optional[constr(strict=True, min_length :type doi: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_get_with_http_info(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, data_type, studyset_owner, level, pmid, doi, flat, **kwargs) # noqa: E501 - - @validate_arguments - def studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, unique : Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, data_type : Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, level : Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, pmid : Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, doi : Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of studies # noqa: E501 + """ # noqa: E501 + + _param = self._studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + data_type=data_type, + studyset_owner=studyset_owner, + level=level, + pmid=pmid, + doi=doi, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - List studies # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyList]: + """GET a list of studies - >>> thread = api.studies_get_with_http_info(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, data_type, studyset_owner, level, pmid, doi, flat, async_req=True) - >>> result = thread.get() + List studies :param search: search for entries that contain the substring :type search: str @@ -865,318 +1609,636 @@ def studies_get_with_http_info(self, search : Annotated[Optional[constr(strict=T :type doi: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'nested', - 'name', - 'description', - 'source_id', - 'unique', - 'source', - 'authors', - 'user_id', - 'data_type', - 'studyset_owner', - 'level', - 'pmid', - 'doi', - 'flat' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + data_type=data_type, + studyset_owner=studyset_owner, + level=level, + pmid=pmid, + doi=doi, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) - - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) - - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) - - if _params.get('unique') is not None: # noqa: E501 - _query_params.append(('unique', _params['unique'])) - - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) - - if _params.get('authors') is not None: # noqa: E501 - _query_params.append(('authors', _params['authors'])) - - if _params.get('user_id') is not None: # noqa: E501 - _query_params.append(('user_id', _params['user_id'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('data_type') is not None: # noqa: E501 - _query_params.append(('data_type', _params['data_type'].value)) - if _params.get('studyset_owner') is not None: # noqa: E501 - _query_params.append(('studyset_owner', _params['studyset_owner'])) + @validate_call + def studies_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + data_type: Annotated[Optional[StrictStr], Field(description="whether searching for studies that contain coordinates, images, or both")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + level: Annotated[Optional[StrictStr], Field(description="select between studies with group results or meta results")] = None, + pmid: Annotated[Optional[StrictStr], Field(description="search for particular pmid")] = None, + doi: Annotated[Optional[StrictStr], Field(description="search for study with specific doi")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of studies - if _params.get('level') is not None: # noqa: E501 - _query_params.append(('level', _params['level'].value)) + List studies - if _params.get('pmid') is not None: # noqa: E501 - _query_params.append(('pmid', _params['pmid'])) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param unique: whether to list clones with originals + :type unique: object + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param authors: search authors + :type authors: str + :param user_id: user id you want to filter by + :type user_id: str + :param data_type: whether searching for studies that contain coordinates, images, or both + :type data_type: str + :param studyset_owner: for all studies filter which studysets are listed based on who owns the studyset + :type studyset_owner: str + :param level: select between studies with group results or meta results + :type level: str + :param pmid: search for particular pmid + :type pmid: str + :param doi: search for study with specific doi + :type doi: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + data_type=data_type, + studyset_owner=studyset_owner, + level=level, + pmid=pmid, + doi=doi, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('doi') is not None: # noqa: E501 - _query_params.append(('doi', _params['doi'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _studies_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + nested, + name, + description, + source_id, + unique, + source, + authors, + user_id, + data_type, + studyset_owner, + level, + pmid, + doi, + flat, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if nested is not None: + + _query_params.append(('nested', nested)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + + if unique is not None: + + _query_params.append(('unique', unique)) + + if source is not None: + + _query_params.append(('source', source)) + + if authors is not None: + + _query_params.append(('authors', authors)) + + if user_id is not None: + + _query_params.append(('user_id', user_id)) + + if data_type is not None: + + _query_params.append(('data_type', data_type)) + + if studyset_owner is not None: + + _query_params.append(('studyset_owner', studyset_owner)) + + if level is not None: + + _query_params.append(('level', level)) + + if pmid is not None: + + _query_params.append(('pmid', pmid)) + + if doi is not None: + + _query_params.append(('doi', doi)) + + if flat is not None: + + _query_params.append(('flat', flat)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "StudyList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studies/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def studies_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a study # noqa: E501 - delete a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def studies_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a study - >>> thread = api.studies_id_delete(id, async_req=True) - >>> result = thread.get() + delete a study :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def studies_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - delete a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a study - >>> thread = api.studies_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + delete a study :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._studies_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studies_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a study + + delete a study + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studies_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/studies/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studies_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> StudyReturn: # noqa: E501 - """GET a study # noqa: E501 - Get a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_id_get(id, nested, studyset_owner, flat, async_req=True) - >>> result = thread.get() + @validate_call + def studies_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyReturn: + """GET a study + + Get a study. :param id: (required) :type id: str @@ -1186,32 +2248,77 @@ def studies_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool] :type studyset_owner: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_id_get_with_http_info(id, nested, studyset_owner, flat, **kwargs) # noqa: E501 - - @validate_arguments - def studies_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, studyset_owner : Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, flat : Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_id_get_serialize( + id=id, + nested=nested, + studyset_owner=studyset_owner, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Get a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyReturn]: + """GET a study - >>> thread = api.studies_id_get_with_http_info(id, nested, studyset_owner, flat, async_req=True) - >>> result = thread.get() + Get a study. :param id: (required) :type id: str @@ -1221,281 +2328,522 @@ def studies_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optio :type studyset_owner: str :param flat: do not return any embedded relationships. When set, it is incompatible with nested. :type flat: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studies_id_get_serialize( + id=id, + nested=nested, + studyset_owner=studyset_owner, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'nested', - 'studyset_owner', - 'flat' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def studies_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + studyset_owner: Annotated[Optional[StrictStr], Field(description="for all studies filter which studysets are listed based on who owns the studyset")] = None, + flat: Annotated[Optional[StrictBool], Field(description="do not return any embedded relationships. When set, it is incompatible with nested. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] - ) + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a study - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + Get a study. - _collection_formats = {} + :param id: (required) + :type id: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param studyset_owner: for all studies filter which studysets are listed based on who owns the studyset + :type studyset_owner: str + :param flat: do not return any embedded relationships. When set, it is incompatible with nested. + :type flat: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_id_get_serialize( + id=id, + nested=nested, + studyset_owner=studyset_owner, + flat=flat, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + def _studies_id_get_serialize( + self, + id, + nested, + studyset_owner, + flat, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params.get('studyset_owner') is not None: # noqa: E501 - _query_params.append(('studyset_owner', _params['studyset_owner'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('flat') is not None: # noqa: E501 - _query_params.append(('flat', _params['flat'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if nested is not None: + + _query_params.append(('nested', nested)) + + if studyset_owner is not None: + + _query_params.append(('studyset_owner', studyset_owner)) + + if flat is not None: + + _query_params.append(('flat', flat)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudyReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/studies/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def studies_id_put(self, id : StrictStr, study_request : Optional[StudyRequest] = None, **kwargs) -> StudyReturn: # noqa: E501 - """PUT/update a study # noqa: E501 - Update a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_id_put(id, study_request, async_req=True) - >>> result = thread.get() + + @validate_call + def studies_id_put( + self, + id: StrictStr, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyReturn: + """PUT/update a study + + Update a study. :param id: (required) :type id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_id_put_with_http_info(id, study_request, **kwargs) # noqa: E501 - - @validate_arguments - def studies_id_put_with_http_info(self, id : StrictStr, study_request : Optional[StudyRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_id_put_serialize( + id=id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Update a study. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_id_put_with_http_info( + self, + id: StrictStr, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyReturn]: + """PUT/update a study - >>> thread = api.studies_id_put_with_http_info(id, study_request, async_req=True) - >>> result = thread.get() + Update a study. :param id: (required) :type id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studies_id_put_serialize( + id=id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id', - 'study_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studies_id_put_without_preload_content( + self, + id: StrictStr, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a study + + Update a study. + + :param id: (required) + :type id: str + :param study_request: + :type study_request: StudyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_id_put_serialize( + id=id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studies_id_put_serialize( + self, + id, + study_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['study_request'] is not None: - _body_params = _params['study_request'] + if study_request is not None: + _body_params = study_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudyReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studies/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/studies/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studies_post(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, study_request : Optional[StudyRequest] = None, **kwargs) -> StudyReturn: # noqa: E501 - """POST/create a study # noqa: E501 - Create a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studies_post(source, source_id, study_request, async_req=True) - >>> result = thread.get() + @validate_call + def studies_post( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudyReturn: + """POST/create a study + + Create a study :param source: the source of the resource you would like to filter/copy from :type source: str @@ -1503,32 +2851,74 @@ def studies_post(self, source : Annotated[Optional[StrictStr], Field(description :type source_id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studies_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studies_post_with_http_info(source, source_id, study_request, **kwargs) # noqa: E501 - - @validate_arguments - def studies_post_with_http_info(self, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, study_request : Optional[StudyRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create a study # noqa: E501 + """ # noqa: E501 + + _param = self._studies_post_serialize( + source=source, + source_id=source_id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - Create a study # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studies_post_with_http_info( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudyReturn]: + """POST/create a study - >>> thread = api.studies_post_with_http_info(source, source_id, study_request, async_req=True) - >>> result = thread.get() + Create a study :param source: the source of the resource you would like to filter/copy from :type source: str @@ -1536,114 +2926,205 @@ def studies_post_with_http_info(self, source : Annotated[Optional[StrictStr], Fi :type source_id: str :param study_request: :type study_request: StudyRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studies_post_serialize( + source=source, + source_id=source_id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'source', - 'source_id', - 'study_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studies_post_without_preload_content( + self, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + study_request: Optional[StudyRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a study + + Create a study + + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param study_request: + :type study_request: StudyRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studies_post_serialize( + source=source, + source_id=source_id, + study_request=study_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studies_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudyReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _studies_post_serialize( + self, + source, + source_id, + study_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if source is not None: + + _query_params.append(('source', source)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['study_request'] is not None: - _body_params = _params['study_request'] + if study_request is not None: + _body_params = study_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudyReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studies/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/studies/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/studysets_api.py b/neurostore_sdk/api/studysets_api.py index 138ba2f..4bc43e4 100644 --- a/neurostore_sdk/api/studysets_api.py +++ b/neurostore_sdk/api/studysets_api.py @@ -3,61 +3,77 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, constr - +from pydantic import Field, StrictBool, StrictStr, field_validator from typing import Any, Optional - +from typing_extensions import Annotated from neurostore_sdk.models.studyset_list import StudysetList from neurostore_sdk.models.studyset_request import StudysetRequest from neurostore_sdk.models.studyset_return import StudysetReturn -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class StudysetsApi(object): +class StudysetsApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def studysets_get(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, unique : Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, **kwargs) -> StudysetList: # noqa: E501 - """GET a list of studysets # noqa: E501 - Get a list of studysets. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def studysets_get( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetList: + """GET a list of studysets - >>> thread = api.studysets_get(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, async_req=True) - >>> result = thread.get() + Get a list of studysets. :param search: search for entries that contain the substring :type search: str @@ -85,32 +101,94 @@ def studysets_get(self, search : Annotated[Optional[constr(strict=True, min_leng :type authors: str :param user_id: user id you want to filter by :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_get_with_http_info(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_get_with_http_info(self, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of results to show on a page")] = None, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, source_id : Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, unique : Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, source : Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, authors : Annotated[Optional[StrictStr], Field(description="search authors")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of studysets # noqa: E501 - - Get a list of studysets. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.studysets_get_with_http_info(search, sort, page, desc, page_size, nested, name, description, source_id, unique, source, authors, user_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_get_with_http_info( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetList]: + """GET a list of studysets + + Get a list of studysets. :param search: search for entries that contain the substring :type search: str @@ -138,294 +216,575 @@ def studysets_get_with_http_info(self, search : Annotated[Optional[constr(strict :type authors: str :param user_id: user id you want to filter by :type user_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'sort', - 'page', - 'desc', - 'page_size', - 'nested', - 'name', - 'description', - 'source_id', - 'unique', - 'source', - 'authors', - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._studysets_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) - - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - - if _params.get('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - if _params.get('source_id') is not None: # noqa: E501 - _query_params.append(('source_id', _params['source_id'])) + @validate_call + def studysets_get_without_preload_content( + self, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of results to show on a page")] = None, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + source_id: Annotated[Optional[StrictStr], Field(description="id of the resource you are either filtering/copying on")] = None, + unique: Annotated[Optional[Any], Field(description="whether to list clones with originals")] = None, + source: Annotated[Optional[StrictStr], Field(description="the source of the resource you would like to filter/copy from")] = None, + authors: Annotated[Optional[StrictStr], Field(description="search authors")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a list of studysets - if _params.get('unique') is not None: # noqa: E501 - _query_params.append(('unique', _params['unique'])) + Get a list of studysets. - if _params.get('source') is not None: # noqa: E501 - _query_params.append(('source', _params['source'].value)) + :param search: search for entries that contain the substring + :type search: str + :param sort: Parameter to sort results on + :type sort: str + :param page: page of results + :type page: int + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param page_size: number of results to show on a page + :type page_size: int + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param name: search the name field for a term + :type name: str + :param description: search description field for a term + :type description: str + :param source_id: id of the resource you are either filtering/copying on + :type source_id: str + :param unique: whether to list clones with originals + :type unique: object + :param source: the source of the resource you would like to filter/copy from + :type source: str + :param authors: search authors + :type authors: str + :param user_id: user id you want to filter by + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_get_serialize( + search=search, + sort=sort, + page=page, + desc=desc, + page_size=page_size, + nested=nested, + name=name, + description=description, + source_id=source_id, + unique=unique, + source=source, + authors=authors, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('authors') is not None: # noqa: E501 - _query_params.append(('authors', _params['authors'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _studysets_get_serialize( + self, + search, + sort, + page, + desc, + page_size, + nested, + name, + description, + source_id, + unique, + source, + authors, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('user_id') is not None: # noqa: E501 - _query_params.append(('user_id', _params['user_id'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + # process the query parameters + if search is not None: + + _query_params.append(('search', search)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if page is not None: + + _query_params.append(('page', page)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if nested is not None: + + _query_params.append(('nested', nested)) + + if name is not None: + + _query_params.append(('name', name)) + + if description is not None: + + _query_params.append(('description', description)) + + if source_id is not None: + + _query_params.append(('source_id', source_id)) + + if unique is not None: + + _query_params.append(('unique', unique)) + + if source is not None: + + _query_params.append(('source', source)) + + if authors is not None: + + _query_params.append(('authors', authors)) + + if user_id is not None: + + _query_params.append(('user_id', user_id)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "StudysetList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studysets/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studysets/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studysets_id_delete(self, id : StrictStr, **kwargs) -> None: # noqa: E501 - """DELETE a studyset # noqa: E501 - delete a studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_id_delete(id, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_id_delete( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """DELETE a studyset + + delete a studyset :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """DELETE a studyset # noqa: E501 - - delete a studyset # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.studysets_id_delete_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_id_delete_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """DELETE a studyset + + delete a studyset :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._studysets_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studysets_id_delete_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """DELETE a studyset + + delete a studyset + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studysets_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/studysets/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/studysets/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studysets_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, gzip : Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """GET a studyset # noqa: E501 - Retrieve the information of a studyset with the matching studyset ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_id_get(id, nested, gzip, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + gzip: Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetReturn: + """GET a studyset + + Retrieve the information of a studyset with the matching studyset ID. :param id: (required) :type id: str @@ -433,32 +792,75 @@ def studysets_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBoo :type nested: bool :param gzip: return the content as gzipped content :type gzip: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_id_get_with_http_info(id, nested, gzip, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, gzip : Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a studyset # noqa: E501 - - Retrieve the information of a studyset with the matching studyset ID. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.studysets_id_get_with_http_info(id, nested, gzip, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + nested=nested, + gzip=gzip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + gzip: Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetReturn]: + """GET a studyset + + Retrieve the information of a studyset with the matching studyset ID. :param id: (required) :type id: str @@ -466,409 +868,760 @@ def studysets_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Opt :type nested: bool :param gzip: return the content as gzipped content :type gzip: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + nested=nested, + gzip=gzip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'nested', - 'gzip' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def studysets_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="whether to show the URI to a resource (false) or to embed the object in the response (true)")] = None, + gzip: Annotated[Optional[StrictBool], Field(description="return the content as gzipped content")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """GET a studyset + + Retrieve the information of a studyset with the matching studyset ID. + + :param id: (required) + :type id: str + :param nested: whether to show the URI to a resource (false) or to embed the object in the response (true) + :type nested: bool + :param gzip: return the content as gzipped content + :type gzip: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + nested=nested, + gzip=gzip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '404': "StudysetsIdGet404Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studysets_id_get_serialize( + self, + id, + nested, + gzip, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('gzip') is not None: # noqa: E501 - _query_params.append(('gzip', _params['gzip'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if nested is not None: + + _query_params.append(('nested', nested)) + + if gzip is not None: + + _query_params.append(('gzip', gzip)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/gzip']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/gzip' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetReturn", - '404': "StudysetsIdGet404Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/studysets/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studysets/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def studysets_id_put(self, id : StrictStr, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """PUT/update a studyset # noqa: E501 - Update a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_id_put(id, studyset_request, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_id_put( + self, + id: StrictStr, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetReturn: + """PUT/update a studyset + + Update a studyset. :param id: (required) :type id: str :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_id_put_with_http_info(id, studyset_request, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_put_with_http_info(self, id : StrictStr, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """PUT/update a studyset # noqa: E501 - - Update a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.studysets_id_put_with_http_info(id, studyset_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_id_put_with_http_info( + self, + id: StrictStr, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetReturn]: + """PUT/update a studyset + + Update a studyset. :param id: (required) :type id: str :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'studyset_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def studysets_id_put_without_preload_content( + self, + id: StrictStr, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """PUT/update a studyset + + Update a studyset. + + :param id: (required) + :type id: str + :param studyset_request: + :type studyset_request: StudysetRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '422': "StudysetsIdPut422Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _studysets_id_put_serialize( + self, + id, + studyset_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['studyset_request'] is not None: - _body_params = _params['studyset_request'] + if studyset_request is not None: + _body_params = studyset_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudysetReturn", - '422': "StudysetsIdPut422Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studysets/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/studysets/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def studysets_post(self, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """POST/create a studyset # noqa: E501 - Create a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studysets_post(studyset_request, async_req=True) - >>> result = thread.get() + + @validate_call + def studysets_post( + self, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> StudysetReturn: + """POST/create a studyset + + Create a studyset. :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studysets_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studysets_post_with_http_info(studyset_request, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_post_with_http_info(self, studyset_request : Optional[StudysetRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """POST/create a studyset # noqa: E501 - - Create a studyset. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.studysets_post_with_http_info(studyset_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def studysets_post_with_http_info( + self, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[StudysetReturn]: + """POST/create a studyset + + Create a studyset. :param studyset_request: :type studyset_request: StudysetRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'studyset_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def studysets_post_without_preload_content( + self, + studyset_request: Optional[StudysetRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """POST/create a studyset + + Create a studyset. + + :param studyset_request: + :type studyset_request: StudysetRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_request=studyset_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method studysets_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _studysets_post_serialize( + self, + studyset_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['studyset_request'] is not None: - _body_params = _params['studyset_request'] + if studyset_request is not None: + _body_params = studyset_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "StudysetReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/studysets/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/studysets/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api/user_api.py b/neurostore_sdk/api/user_api.py index 08e3ba6..284974e 100644 --- a/neurostore_sdk/api/user_api.py +++ b/neurostore_sdk/api/user_api.py @@ -3,616 +3,1107 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" - +""" # noqa: E501 -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from pydantic import StrictStr - from typing import Optional - from neurostore_sdk.models.user import User from neurostore_sdk.models.user_list import UserList -from neurostore_sdk.api_client import ApiClient +from neurostore_sdk.api_client import ApiClient, RequestSerialized from neurostore_sdk.api_response import ApiResponse -from neurostore_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurostore_sdk.rest import RESTResponseType -class UserApi(object): +class UserApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def users_get(self, **kwargs) -> UserList: # noqa: E501 - """Your GET endpoint # noqa: E501 - get list of users # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def users_get( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserList: + """Your GET endpoint - >>> thread = api.users_get(async_req=True) - >>> result = thread.get() + get list of users - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the users_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.users_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def users_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 - - get list of users # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.users_get_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._users_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_get_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserList]: + """Your GET endpoint + + get list of users + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_get_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Your GET endpoint + + get list of users + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _users_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = { - '200': "UserList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/users/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/users/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def users_id_get(self, id : StrictStr, **kwargs) -> User: # noqa: E501 - """Individual User Profile # noqa: E501 - get an individual user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def users_id_get( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Individual User Profile + + get an individual user :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the users_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.users_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def users_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Individual User Profile # noqa: E501 + """ # noqa: E501 + + _param = self._users_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - get an individual user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_id_get_with_http_info( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Individual User Profile - >>> thread = api.users_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + get an individual user :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_id_get_without_preload_content( + self, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Individual User Profile + + get an individual user + + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _users_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "User", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/users/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def users_id_put(self, id : StrictStr, user : Optional[User] = None, **kwargs) -> User: # noqa: E501 - """Update Individual Profile # noqa: E501 - update an individual user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.users_id_put(id, user, async_req=True) - >>> result = thread.get() + + @validate_call + def users_id_put( + self, + id: StrictStr, + user: Optional[User] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """Update Individual Profile + + update an individual user :param id: (required) :type id: str :param user: :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the users_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.users_id_put_with_http_info(id, user, **kwargs) # noqa: E501 - - @validate_arguments - def users_id_put_with_http_info(self, id : StrictStr, user : Optional[User] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update Individual Profile # noqa: E501 + """ # noqa: E501 + + _param = self._users_id_put_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an individual user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_id_put_with_http_info( + self, + id: StrictStr, + user: Optional[User] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """Update Individual Profile - >>> thread = api.users_id_put_with_http_info(id, user, async_req=True) - >>> result = thread.get() + update an individual user :param id: (required) :type id: str :param user: :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_id_put_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'id', - 'user' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_id_put_without_preload_content( + self, + id: StrictStr, + user: Optional[User] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Individual Profile + + update an individual user + + :param id: (required) + :type id: str + :param user: + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_id_put_serialize( + id=id, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + def _users_id_put_serialize( + self, + id, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user'] is not None: - _body_params = _params['user'] + if user is not None: + _body_params = user + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "User", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/users/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/users/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def users_post(self, user : Optional[User] = None, **kwargs) -> User: # noqa: E501 - """ # noqa: E501 - create a user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def users_post( + self, + user: Optional[User] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """ - >>> thread = api.users_post(user, async_req=True) - >>> result = thread.get() + create a user :param user: :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: User - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the users_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.users_post_with_http_info(user, **kwargs) # noqa: E501 - - @validate_arguments - def users_post_with_http_info(self, user : Optional[User] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._users_post_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a user # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def users_post_with_http_info( + self, + user: Optional[User] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """ - >>> thread = api.users_post_with_http_info(user, async_req=True) - >>> result = thread.get() + create a user :param user: :type user: User - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._users_post_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'user' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def users_post_without_preload_content( + self, + user: Optional[User] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """ + + create a user + + :param user: + :type user: User + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._users_post_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method users_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "User", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _users_post_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user'] is not None: - _body_params = _params['user'] + if user is not None: + _body_params = user + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "User", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/users/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/users/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/neurostore_sdk/api_client.py b/neurostore_sdk/api_client.py index b10c42e..f6e1e9c 100644 --- a/neurostore_sdk/api_client.py +++ b/neurostore_sdk/api_client.py @@ -3,36 +3,47 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 -import atexit import datetime from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from neurostore_sdk.configuration import Configuration -from neurostore_sdk.api_response import ApiResponse +from neurostore_sdk.api_response import ApiResponse, T as ApiResponseT import neurostore_sdk.models from neurostore_sdk import rest -from neurostore_sdk.exceptions import ApiValueError, ApiException - - -class ApiClient(object): +from neurostore_sdk.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -46,8 +57,6 @@ class ApiClient(object): the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) @@ -59,17 +68,22 @@ class ApiClient(object): 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -84,25 +98,7 @@ def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -143,13 +139,42 @@ def set_default(cls, default): """ cls._default = default - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -160,14 +185,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -179,22 +207,30 @@ def __call_api( if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( - header_params, query_params, auth_settings, - resource_path, method, body, - request_auth=_request_auth) + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -203,64 +239,109 @@ def __call_api( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, - collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data - - return_data = None # assuming derialization is not needed - # data needs deserialization or returns HTTP data (deserialized) only - if _preload_content or _return_http_data_only: - response_type = response_types_map.get(str(response_data.status), None) - - if response_type == "bytearray": - response_data.data = response_data.data - else: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type == "bytearray": - return_data = response_data.data - elif response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return return_data - else: - return ApiResponse(status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data) + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -270,18 +351,26 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -289,30 +378,45 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = obj.to_dict() + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -327,14 +431,18 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -352,138 +460,13 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None, _preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_types_map, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _request_auth) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _request_auth)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.get_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.head_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.options_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.post_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.put_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.patch_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.delete_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -491,10 +474,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -521,21 +504,21 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, (int, float)): - v = str(v) + for k, v in params.items() if isinstance(params, dict) else params: if isinstance(v, bool): v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) if isinstance(v, dict): v = json.dumps(v) if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' @@ -546,44 +529,56 @@ def parameters_to_url_query(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(quote(str(value)) for value in v))) + (k, delimiter.join(quote(str(value)) for value in v)) + ) else: new_params.append((k, quote(str(v)))) - return "&".join(["=".join(item) for item in new_params]) + return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None for accept in accepts: if re.search('json', accept, re.IGNORECASE): @@ -606,9 +601,16 @@ def select_header_content_type(self, content_types): return content_types[0] - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, - request_auth=None): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -625,21 +627,36 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, - resource_path, method, body, - request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, - resource_path, method, body, - auth_setting) - - def _apply_auth_params(self, headers, queries, - resource_path, method, body, - auth_setting): + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -668,6 +685,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -677,8 +697,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -745,6 +769,24 @@ def __deserialize_datetime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/neurostore_sdk/api_response.py b/neurostore_sdk/api_response.py index d81c2ff..9bc7c11 100644 --- a/neurostore_sdk/api_response.py +++ b/neurostore_sdk/api_response.py @@ -1,25 +1,21 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel -class ApiResponse: +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): """ API response object """ - status_code: Optional[StrictInt] = Field(None, description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") - data: Optional[Any] = Field(None, description="Deserialized data given the data type") - raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - def __init__(self, - status_code=None, - headers=None, - data=None, - raw_data=None): - self.status_code = status_code - self.headers = headers - self.data = data - self.raw_data = raw_data + model_config = { + "arbitrary_types_allowed": True + } diff --git a/neurostore_sdk/configuration.py b/neurostore_sdk/configuration.py index 8aa6738..bbd94a5 100644 --- a/neurostore_sdk/configuration.py +++ b/neurostore_sdk/configuration.py @@ -3,24 +3,27 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 import copy +import http.client as httplib import logging +from logging import FileHandler import multiprocessing import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing_extensions import NotRequired, Self + import urllib3 -import http.client as httplib -from neurostore_sdk.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -28,10 +31,114 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } -class Configuration(object): +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "JSON-Web-Token": BearerAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -50,23 +157,35 @@ class Configuration(object): configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. :Example: """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ self._base_path = "https://neurostore.org/api" if host is None else host @@ -80,6 +199,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -106,9 +228,6 @@ def __init__(self, host=None, self.access_token = access_token """Access token """ - self.access_token = None - """access token for OAuth/Bearer - """ self.logger = {} """Logging Settings """ @@ -120,13 +239,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -160,7 +282,7 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None @@ -169,7 +291,7 @@ def __init__(self, host=None, self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation @@ -187,7 +309,7 @@ def __init__(self, host=None, """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -201,11 +323,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -216,7 +338,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -226,7 +348,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -236,11 +358,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -252,7 +374,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -271,7 +393,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -280,7 +402,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -302,7 +424,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -313,7 +435,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -324,7 +446,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -341,7 +463,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -356,12 +480,12 @@ def get_basic_auth_token(self): basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if self.access_token is not None: auth['JSON-Web-Token'] = { 'type': 'bearer', @@ -371,7 +495,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -383,7 +507,7 @@ def to_debug_report(self): "SDK Package Version: 0.0.1".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -399,7 +523,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -439,12 +568,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/neurostore_sdk/exceptions.py b/neurostore_sdk/exceptions.py index cead54c..2d8a028 100644 --- a/neurostore_sdk/exceptions.py +++ b/neurostore_sdk/exceptions.py @@ -3,15 +3,17 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -19,7 +21,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): + key_type=None) -> None: """ Raises an exception for TypeErrors Args: @@ -47,7 +49,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -65,7 +67,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -84,7 +86,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -102,17 +104,63 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -122,34 +170,40 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message -class NotFoundException(ApiException): +class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None): - super(NotFoundException, self).__init__(status, reason, http_resp) +class NotFoundException(ApiException): + pass -class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): - super(UnauthorizedException, self).__init__(status, reason, http_resp) +class UnauthorizedException(ApiException): + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None): - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + - def __init__(self, status=None, reason=None, http_resp=None): - super(ServiceException, self).__init__(status, reason, http_resp) +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass def render_path(path_to_item): diff --git a/neurostore_sdk/models/__init__.py b/neurostore_sdk/models/__init__.py index 0c8839a..60c2fc2 100644 --- a/neurostore_sdk/models/__init__.py +++ b/neurostore_sdk/models/__init__.py @@ -4,14 +4,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 # import models into model package @@ -59,15 +59,22 @@ from neurostore_sdk.models.image_relationships import ImageRelationships from neurostore_sdk.models.image_request import ImageRequest from neurostore_sdk.models.image_return import ImageReturn -from neurostore_sdk.models.json_ld import JsonLd from neurostore_sdk.models.json_ld_context import JsonLdContext -from neurostore_sdk.models.metadata import Metadata from neurostore_sdk.models.nested_put_attributes import NestedPutAttributes from neurostore_sdk.models.note_collection_base import NoteCollectionBase from neurostore_sdk.models.note_collection_list import NoteCollectionList from neurostore_sdk.models.note_collection_request import NoteCollectionRequest from neurostore_sdk.models.note_collection_return import NoteCollectionReturn -from neurostore_sdk.models.note_collection_return_all_of import NoteCollectionReturnAllOf +from neurostore_sdk.models.pipeline import Pipeline +from neurostore_sdk.models.pipeline_config import PipelineConfig +from neurostore_sdk.models.pipeline_config_list import PipelineConfigList +from neurostore_sdk.models.pipeline_list import PipelineList +from neurostore_sdk.models.pipeline_run import PipelineRun +from neurostore_sdk.models.pipeline_run_list import PipelineRunList +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from neurostore_sdk.models.pipeline_run_result_list import PipelineRunResultList +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from neurostore_sdk.models.pipeline_run_result_vote_list import PipelineRunResultVoteList from neurostore_sdk.models.point_base import PointBase from neurostore_sdk.models.point_common import PointCommon from neurostore_sdk.models.point_list import PointList @@ -76,19 +83,16 @@ from neurostore_sdk.models.point_request import PointRequest from neurostore_sdk.models.point_return import PointReturn from neurostore_sdk.models.point_value import PointValue -from neurostore_sdk.models.readable_resource_attributes import ReadableResourceAttributes from neurostore_sdk.models.resource_attributes import ResourceAttributes from neurostore_sdk.models.study_base import StudyBase 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 -from neurostore_sdk.models.study_return_all_of import StudyReturnAllOf -from neurostore_sdk.models.study_return_all_of_studysets_inner import StudyReturnAllOfStudysetsInner -from neurostore_sdk.models.study_return_all_of_studysets_inner_one_of import StudyReturnAllOfStudysetsInnerOneOf +from neurostore_sdk.models.study_return_all_of_studysets import StudyReturnAllOfStudysets +from neurostore_sdk.models.study_return_all_of_studysets_one_of import StudyReturnAllOfStudysetsOneOf from neurostore_sdk.models.study_return_relationships import StudyReturnRelationships from neurostore_sdk.models.study_return_relationships_analyses import StudyReturnRelationshipsAnalyses from neurostore_sdk.models.studyset_base import StudysetBase @@ -102,6 +106,4 @@ from neurostore_sdk.models.studysets_id_put422_response import StudysetsIdPut422Response from neurostore_sdk.models.user import User from neurostore_sdk.models.user_list import UserList -from neurostore_sdk.models.user_resource_attributes import UserResourceAttributes from neurostore_sdk.models.userless_resource_attributes import UserlessResourceAttributes -from neurostore_sdk.models.writeable_resource_attributes import WriteableResourceAttributes diff --git a/neurostore_sdk/models/analysis_base.py b/neurostore_sdk/models/analysis_base.py index bd32f86..034dba5 100644 --- a/neurostore_sdk/models/analysis_base.py +++ b/neurostore_sdk/models/analysis_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,68 +18,85 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self class AnalysisBase(BaseModel): """ AnalysisBase - """ - name: Optional[StrictStr] = Field(None, description="A name of the contrast being performed.") - description: Optional[StrictStr] = Field(None, description="A long form description of how the contrast was performed") - weights: Optional[conlist(Union[StrictFloat, StrictInt])] = Field(None, description="Weight applied to each condition, must be the same length as the conditions attribute.") - __properties = ["name", "description", "weights"] + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="A name of the contrast being performed.") + description: Optional[StrictStr] = Field(default=None, description="A long form description of how the contrast was performed") + weights: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="Weight applied to each condition, must be the same length as the conditions attribute.") + __properties: ClassVar[List[str]] = ["name", "description", "weights"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisBase.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "weights": obj.get("weights") }) return _obj + diff --git a/neurostore_sdk/models/analysis_common.py b/neurostore_sdk/models/analysis_common.py index 3cd3017..30f4e2d 100644 --- a/neurostore_sdk/models/analysis_common.py +++ b/neurostore_sdk/models/analysis_common.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,71 +18,95 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.entity import Entity +from typing import Optional, Set +from typing_extensions import Self class AnalysisCommon(BaseModel): """ attributes common between request and return objects - """ + """ # noqa: E501 study: Optional[StrictStr] = None - entities: Optional[conlist(Entity)] = None + entities: Optional[List[Entity]] = None order: Optional[StrictInt] = None - __properties = ["study", "entities", "order"] + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["study", "entities", "order", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisCommon: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisCommon 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if order (nullable) is None - # and __fields_set__ contains the field - if self.order is None and "order" in self.__fields_set__: + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: _dict['order'] = None + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisCommon: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisCommon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisCommon.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisCommon.parse_obj({ + _obj = cls.model_validate({ "study": obj.get("study"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, - "order": obj.get("order") + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, + "order": obj.get("order"), + "metadata": obj.get("metadata") }) return _obj + diff --git a/neurostore_sdk/models/analysis_list.py b/neurostore_sdk/models/analysis_list.py index 4385bc3..41ea5ef 100644 --- a/neurostore_sdk/models/analysis_list.py +++ b/neurostore_sdk/models/analysis_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,68 +18,84 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.analysis_return import AnalysisReturn -from neurostore_sdk.models.metadata import Metadata +from typing import Optional, Set +from typing_extensions import Self class AnalysisList(BaseModel): """ AnalysisList - """ + """ # noqa: E501 metadata: Optional[Metadata] = None - results: Optional[conlist(AnalysisReturn)] = None - __properties = ["metadata", "results"] + results: Optional[List[AnalysisReturn]] = None + __properties: ClassVar[List[str]] = ["metadata", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: _dict['metadata'] = self.metadata.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisList.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisList.parse_obj({ - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None, - "results": [AnalysisReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + _obj = cls.model_validate({ + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None, + "results": [AnalysisReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/analysis_request.py b/neurostore_sdk/models/analysis_request.py index 8676466..8bd81d0 100644 --- a/neurostore_sdk/models/analysis_request.py +++ b/neurostore_sdk/models/analysis_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,55 +18,73 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from neurostore_sdk.models.analysis_request_relationships_conditions import AnalysisRequestRelationshipsConditions from neurostore_sdk.models.analysis_request_relationships_images import AnalysisRequestRelationshipsImages from neurostore_sdk.models.analysis_request_relationships_points import AnalysisRequestRelationshipsPoints from neurostore_sdk.models.entity import Entity +from typing import Optional, Set +from typing_extensions import Self class AnalysisRequest(BaseModel): """ AnalysisRequest - """ - name: Optional[StrictStr] = Field(None, description="A name of the contrast being performed.") - description: Optional[StrictStr] = Field(None, description="A long form description of how the contrast was performed") - weights: Optional[conlist(Union[StrictFloat, StrictInt])] = Field(None, description="Weight applied to each condition, must be the same length as the conditions attribute.") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="A name of the contrast being performed.") + description: Optional[StrictStr] = Field(default=None, description="A long form description of how the contrast was performed") + weights: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="Weight applied to each condition, must be the same length as the conditions attribute.") study: Optional[StrictStr] = None images: Optional[AnalysisRequestRelationshipsImages] = None points: Optional[AnalysisRequestRelationshipsPoints] = None conditions: Optional[AnalysisRequestRelationshipsConditions] = None - id: Optional[constr(strict=True, max_length=30, 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") - entities: Optional[conlist(Entity)] = None + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + entities: Optional[List[Entity]] = None order: Optional[StrictInt] = None - __properties = ["name", "description", "weights", "study", "images", "points", "conditions", "id", "public", "entities", "order"] + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["name", "description", "weights", "study", "images", "points", "conditions", "id", "public", "entities", "order", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisRequest 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of images if self.images: _dict['images'] = self.images.to_dict() @@ -79,48 +97,55 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if order (nullable) is None - # and __fields_set__ contains the field - if self.order is None and "order" in self.__fields_set__: + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: _dict['order'] = None + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "weights": obj.get("weights"), "study": obj.get("study"), - "images": AnalysisRequestRelationshipsImages.from_dict(obj.get("images")) if obj.get("images") is not None else None, - "points": AnalysisRequestRelationshipsPoints.from_dict(obj.get("points")) if obj.get("points") is not None else None, - "conditions": AnalysisRequestRelationshipsConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None, + "images": AnalysisRequestRelationshipsImages.from_dict(obj["images"]) if obj.get("images") is not None else None, + "points": AnalysisRequestRelationshipsPoints.from_dict(obj["points"]) if obj.get("points") is not None else None, + "conditions": AnalysisRequestRelationshipsConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, "id": obj.get("id"), "public": obj.get("public") if obj.get("public") is not None else True, - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, - "order": obj.get("order") + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, + "order": obj.get("order"), + "metadata": obj.get("metadata") }) return _obj + diff --git a/neurostore_sdk/models/analysis_request_relationships.py b/neurostore_sdk/models/analysis_request_relationships.py index bf5c221..924bc98 100644 --- a/neurostore_sdk/models/analysis_request_relationships.py +++ b/neurostore_sdk/models/analysis_request_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,47 +18,63 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.analysis_request_relationships_conditions import AnalysisRequestRelationshipsConditions from neurostore_sdk.models.analysis_request_relationships_images import AnalysisRequestRelationshipsImages from neurostore_sdk.models.analysis_request_relationships_points import AnalysisRequestRelationshipsPoints +from typing import Optional, Set +from typing_extensions import Self class AnalysisRequestRelationships(BaseModel): """ AnalysisRequestRelationships - """ + """ # noqa: E501 study: Optional[StrictStr] = None images: Optional[AnalysisRequestRelationshipsImages] = None points: Optional[AnalysisRequestRelationshipsPoints] = None conditions: Optional[AnalysisRequestRelationshipsConditions] = None - __properties = ["study", "images", "points", "conditions"] + __properties: ClassVar[List[str]] = ["study", "images", "points", "conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisRequestRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of images if self.images: _dict['images'] = self.images.to_dict() @@ -71,19 +87,20 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisRequestRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisRequestRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisRequestRelationships.parse_obj({ + _obj = cls.model_validate({ "study": obj.get("study"), - "images": AnalysisRequestRelationshipsImages.from_dict(obj.get("images")) if obj.get("images") is not None else None, - "points": AnalysisRequestRelationshipsPoints.from_dict(obj.get("points")) if obj.get("points") is not None else None, - "conditions": AnalysisRequestRelationshipsConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None + "images": AnalysisRequestRelationshipsImages.from_dict(obj["images"]) if obj.get("images") is not None else None, + "points": AnalysisRequestRelationshipsPoints.from_dict(obj["points"]) if obj.get("points") is not None else None, + "conditions": AnalysisRequestRelationshipsConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/analysis_request_relationships_conditions.py b/neurostore_sdk/models/analysis_request_relationships_conditions.py index 75eb6ce..e3267d4 100644 --- a/neurostore_sdk/models/analysis_request_relationships_conditions.py +++ b/neurostore_sdk/models/analysis_request_relationships_conditions.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.condition_request import ConditionRequest -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANALYSISREQUESTRELATIONSHIPSCONDITIONS_ONE_OF_SCHEMAS = ["List[ConditionRequest]", "List[str]"] @@ -32,16 +31,19 @@ class AnalysisRequestRelationshipsConditions(BaseModel): AnalysisRequestRelationshipsConditions """ # data type: List[ConditionRequest] - oneof_schema_1_validator: Optional[conlist(ConditionRequest, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[ConditionRequest], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISREQUESTRELATIONSHIPSCONDITIONS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[ConditionRequest], List[str]]] = None + one_of_schemas: Set[str] = { "List[ConditionRequest]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisRequestRelationshipsConditions.construct() + instance = AnalysisRequestRelationshipsConditions.model_construct() error_messages = [] match = 0 # validate data type: List[ConditionRequest] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationshipsConditions: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationshipsConditions: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnalysisRequestRelationshipsConditions.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[ConditionRequest], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/analysis_request_relationships_conditions_inner.py b/neurostore_sdk/models/analysis_request_relationships_conditions_inner.py deleted file mode 100644 index c0b9c70..0000000 --- a/neurostore_sdk/models/analysis_request_relationships_conditions_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.condition_request import ConditionRequest -from typing import Any, List -from pydantic import StrictStr, Field - -ANALYSISREQUESTRELATIONSHIPSCONDITIONSINNER_ONE_OF_SCHEMAS = ["ConditionRequest", "str"] - -class AnalysisRequestRelationshipsConditionsInner(BaseModel): - """ - AnalysisRequestRelationshipsConditionsInner - """ - # data type: ConditionRequest - oneof_schema_1_validator: Optional[ConditionRequest] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISREQUESTRELATIONSHIPSCONDITIONSINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisRequestRelationshipsConditionsInner.construct() - error_messages = [] - match = 0 - # validate data type: ConditionRequest - if not isinstance(v, ConditionRequest): - error_messages.append(f"Error! Input type `{type(v)}` is not `ConditionRequest`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnalysisRequestRelationshipsConditionsInner with oneOf schemas: ConditionRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnalysisRequestRelationshipsConditionsInner with oneOf schemas: ConditionRequest, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationshipsConditionsInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationshipsConditionsInner: - """Returns the object represented by the json string""" - instance = AnalysisRequestRelationshipsConditionsInner.construct() - error_messages = [] - match = 0 - - # deserialize data into ConditionRequest - try: - instance.actual_instance = ConditionRequest.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnalysisRequestRelationshipsConditionsInner with oneOf schemas: ConditionRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnalysisRequestRelationshipsConditionsInner with oneOf schemas: ConditionRequest, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/analysis_request_relationships_images.py b/neurostore_sdk/models/analysis_request_relationships_images.py index 1be5f3e..f2427b2 100644 --- a/neurostore_sdk/models/analysis_request_relationships_images.py +++ b/neurostore_sdk/models/analysis_request_relationships_images.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.image_request import ImageRequest -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANALYSISREQUESTRELATIONSHIPSIMAGES_ONE_OF_SCHEMAS = ["List[ImageRequest]", "List[str]"] @@ -32,16 +31,19 @@ class AnalysisRequestRelationshipsImages(BaseModel): AnalysisRequestRelationshipsImages """ # data type: List[ImageRequest] - oneof_schema_1_validator: Optional[conlist(ImageRequest, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[ImageRequest], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISREQUESTRELATIONSHIPSIMAGES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[ImageRequest], List[str]]] = None + one_of_schemas: Set[str] = { "List[ImageRequest]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisRequestRelationshipsImages.construct() + instance = AnalysisRequestRelationshipsImages.model_construct() error_messages = [] match = 0 # validate data type: List[ImageRequest] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationshipsImages: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationshipsImages: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnalysisRequestRelationshipsImages.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[ImageRequest], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/analysis_request_relationships_images_inner.py b/neurostore_sdk/models/analysis_request_relationships_images_inner.py deleted file mode 100644 index cf9fde1..0000000 --- a/neurostore_sdk/models/analysis_request_relationships_images_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.image_request import ImageRequest -from typing import Any, List -from pydantic import StrictStr, Field - -ANALYSISREQUESTRELATIONSHIPSIMAGESINNER_ONE_OF_SCHEMAS = ["ImageRequest", "str"] - -class AnalysisRequestRelationshipsImagesInner(BaseModel): - """ - AnalysisRequestRelationshipsImagesInner - """ - # data type: ImageRequest - oneof_schema_1_validator: Optional[ImageRequest] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISREQUESTRELATIONSHIPSIMAGESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisRequestRelationshipsImagesInner.construct() - error_messages = [] - match = 0 - # validate data type: ImageRequest - if not isinstance(v, ImageRequest): - error_messages.append(f"Error! Input type `{type(v)}` is not `ImageRequest`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnalysisRequestRelationshipsImagesInner with oneOf schemas: ImageRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnalysisRequestRelationshipsImagesInner with oneOf schemas: ImageRequest, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationshipsImagesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationshipsImagesInner: - """Returns the object represented by the json string""" - instance = AnalysisRequestRelationshipsImagesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into ImageRequest - try: - instance.actual_instance = ImageRequest.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnalysisRequestRelationshipsImagesInner with oneOf schemas: ImageRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnalysisRequestRelationshipsImagesInner with oneOf schemas: ImageRequest, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/analysis_request_relationships_points.py b/neurostore_sdk/models/analysis_request_relationships_points.py index 1990754..3134ec7 100644 --- a/neurostore_sdk/models/analysis_request_relationships_points.py +++ b/neurostore_sdk/models/analysis_request_relationships_points.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.point_request import PointRequest -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANALYSISREQUESTRELATIONSHIPSPOINTS_ONE_OF_SCHEMAS = ["List[PointRequest]", "List[str]"] @@ -32,16 +31,19 @@ class AnalysisRequestRelationshipsPoints(BaseModel): AnalysisRequestRelationshipsPoints """ # data type: List[PointRequest] - oneof_schema_1_validator: Optional[conlist(PointRequest, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[PointRequest], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISREQUESTRELATIONSHIPSPOINTS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[PointRequest], List[str]]] = None + one_of_schemas: Set[str] = { "List[PointRequest]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisRequestRelationshipsPoints.construct() + instance = AnalysisRequestRelationshipsPoints.model_construct() error_messages = [] match = 0 # validate data type: List[PointRequest] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationshipsPoints: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationshipsPoints: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnalysisRequestRelationshipsPoints.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[PointRequest], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/analysis_request_relationships_points_inner.py b/neurostore_sdk/models/analysis_request_relationships_points_inner.py deleted file mode 100644 index 036da83..0000000 --- a/neurostore_sdk/models/analysis_request_relationships_points_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.point_request import PointRequest -from typing import Any, List -from pydantic import StrictStr, Field - -ANALYSISREQUESTRELATIONSHIPSPOINTSINNER_ONE_OF_SCHEMAS = ["PointRequest", "str"] - -class AnalysisRequestRelationshipsPointsInner(BaseModel): - """ - AnalysisRequestRelationshipsPointsInner - """ - # data type: PointRequest - oneof_schema_1_validator: Optional[PointRequest] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISREQUESTRELATIONSHIPSPOINTSINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisRequestRelationshipsPointsInner.construct() - error_messages = [] - match = 0 - # validate data type: PointRequest - if not isinstance(v, PointRequest): - error_messages.append(f"Error! Input type `{type(v)}` is not `PointRequest`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnalysisRequestRelationshipsPointsInner with oneOf schemas: PointRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnalysisRequestRelationshipsPointsInner with oneOf schemas: PointRequest, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnalysisRequestRelationshipsPointsInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnalysisRequestRelationshipsPointsInner: - """Returns the object represented by the json string""" - instance = AnalysisRequestRelationshipsPointsInner.construct() - error_messages = [] - match = 0 - - # deserialize data into PointRequest - try: - instance.actual_instance = PointRequest.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnalysisRequestRelationshipsPointsInner with oneOf schemas: PointRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnalysisRequestRelationshipsPointsInner with oneOf schemas: PointRequest, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/analysis_return.py b/neurostore_sdk/models/analysis_return.py index ac56917..d2a618c 100644 --- a/neurostore_sdk/models/analysis_return.py +++ b/neurostore_sdk/models/analysis_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,61 +19,83 @@ import json from datetime import datetime -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from neurostore_sdk.models.analysis_return_relationships_conditions import AnalysisReturnRelationshipsConditions from neurostore_sdk.models.analysis_return_relationships_images import AnalysisReturnRelationshipsImages from neurostore_sdk.models.analysis_return_relationships_points import AnalysisReturnRelationshipsPoints from neurostore_sdk.models.entity import Entity +from typing import Optional, Set +from typing_extensions import Self class AnalysisReturn(BaseModel): """ AnalysisReturn - """ - name: Optional[StrictStr] = Field(None, description="A name of the contrast being performed.") - description: Optional[StrictStr] = Field(None, description="A long form description of how the contrast was performed") - weights: Optional[conlist(Union[StrictFloat, StrictInt])] = Field(None, description="Weight applied to each condition, must be the same length as the conditions attribute.") - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="A name of the contrast being performed.") + description: Optional[StrictStr] = Field(default=None, description="A long form description of how the contrast was performed") + weights: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, description="Weight applied to each condition, must be the same length as the conditions attribute.") + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") study: Optional[StrictStr] = None images: Optional[AnalysisReturnRelationshipsImages] = None points: Optional[AnalysisReturnRelationshipsPoints] = None conditions: Optional[AnalysisReturnRelationshipsConditions] = None - entities: Optional[conlist(Entity)] = None + entities: Optional[List[Entity]] = None order: Optional[StrictInt] = None - __properties = ["name", "description", "weights", "created_at", "updated_at", "id", "public", "user", "username", "study", "images", "points", "conditions", "entities", "order"] + metadata: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["name", "description", "weights", "created_at", "updated_at", "id", "public", "user", "username", "study", "images", "points", "conditions", "entities", "order", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisReturn 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={ - "created_at", - "updated_at", - "user", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of images if self.images: _dict['images'] = self.images.to_dict() @@ -86,52 +108,57 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None # set to None if order (nullable) is None - # and __fields_set__ contains the field - if self.order is None and "order" in self.__fields_set__: + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: _dict['order'] = None + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisReturn.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "weights": obj.get("weights"), @@ -142,11 +169,13 @@ def from_dict(cls, obj: dict) -> AnalysisReturn: "user": obj.get("user"), "username": obj.get("username"), "study": obj.get("study"), - "images": AnalysisReturnRelationshipsImages.from_dict(obj.get("images")) if obj.get("images") is not None else None, - "points": AnalysisReturnRelationshipsPoints.from_dict(obj.get("points")) if obj.get("points") is not None else None, - "conditions": AnalysisReturnRelationshipsConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None, - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, - "order": obj.get("order") + "images": AnalysisReturnRelationshipsImages.from_dict(obj["images"]) if obj.get("images") is not None else None, + "points": AnalysisReturnRelationshipsPoints.from_dict(obj["points"]) if obj.get("points") is not None else None, + "conditions": AnalysisReturnRelationshipsConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, + "order": obj.get("order"), + "metadata": obj.get("metadata") }) return _obj + diff --git a/neurostore_sdk/models/analysis_return_relationships.py b/neurostore_sdk/models/analysis_return_relationships.py index 4e05e70..cb54e95 100644 --- a/neurostore_sdk/models/analysis_return_relationships.py +++ b/neurostore_sdk/models/analysis_return_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,47 +18,63 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.analysis_return_relationships_conditions import AnalysisReturnRelationshipsConditions from neurostore_sdk.models.analysis_return_relationships_images import AnalysisReturnRelationshipsImages from neurostore_sdk.models.analysis_return_relationships_points import AnalysisReturnRelationshipsPoints +from typing import Optional, Set +from typing_extensions import Self class AnalysisReturnRelationships(BaseModel): """ AnalysisReturnRelationships - """ + """ # noqa: E501 study: Optional[StrictStr] = None images: Optional[AnalysisReturnRelationshipsImages] = None points: Optional[AnalysisReturnRelationshipsPoints] = None conditions: Optional[AnalysisReturnRelationshipsConditions] = None - __properties = ["study", "images", "points", "conditions"] + __properties: ClassVar[List[str]] = ["study", "images", "points", "conditions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnalysisReturnRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of images if self.images: _dict['images'] = self.images.to_dict() @@ -71,19 +87,20 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnalysisReturnRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnalysisReturnRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnalysisReturnRelationships.parse_obj({ + _obj = cls.model_validate({ "study": obj.get("study"), - "images": AnalysisReturnRelationshipsImages.from_dict(obj.get("images")) if obj.get("images") is not None else None, - "points": AnalysisReturnRelationshipsPoints.from_dict(obj.get("points")) if obj.get("points") is not None else None, - "conditions": AnalysisReturnRelationshipsConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None + "images": AnalysisReturnRelationshipsImages.from_dict(obj["images"]) if obj.get("images") is not None else None, + "points": AnalysisReturnRelationshipsPoints.from_dict(obj["points"]) if obj.get("points") is not None else None, + "conditions": AnalysisReturnRelationshipsConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/analysis_return_relationships_conditions.py b/neurostore_sdk/models/analysis_return_relationships_conditions.py index b9d98d8..a902674 100644 --- a/neurostore_sdk/models/analysis_return_relationships_conditions.py +++ b/neurostore_sdk/models/analysis_return_relationships_conditions.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.condition_return import ConditionReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANALYSISRETURNRELATIONSHIPSCONDITIONS_ONE_OF_SCHEMAS = ["List[ConditionReturn]", "List[str]"] @@ -32,16 +31,19 @@ class AnalysisReturnRelationshipsConditions(BaseModel): AnalysisReturnRelationshipsConditions """ # data type: List[ConditionReturn] - oneof_schema_1_validator: Optional[conlist(ConditionReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[ConditionReturn], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISRETURNRELATIONSHIPSCONDITIONS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[ConditionReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[ConditionReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisReturnRelationshipsConditions.construct() + instance = AnalysisReturnRelationshipsConditions.model_construct() error_messages = [] match = 0 # validate data type: List[ConditionReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationshipsConditions: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationshipsConditions: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnalysisReturnRelationshipsConditions.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[ConditionReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/analysis_return_relationships_conditions_inner.py b/neurostore_sdk/models/analysis_return_relationships_conditions_inner.py deleted file mode 100644 index 3bbf809..0000000 --- a/neurostore_sdk/models/analysis_return_relationships_conditions_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.condition_return import ConditionReturn -from typing import Any, List -from pydantic import StrictStr, Field - -ANALYSISRETURNRELATIONSHIPSCONDITIONSINNER_ONE_OF_SCHEMAS = ["ConditionReturn", "str"] - -class AnalysisReturnRelationshipsConditionsInner(BaseModel): - """ - AnalysisReturnRelationshipsConditionsInner - """ - # data type: ConditionReturn - oneof_schema_1_validator: Optional[ConditionReturn] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISRETURNRELATIONSHIPSCONDITIONSINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisReturnRelationshipsConditionsInner.construct() - error_messages = [] - match = 0 - # validate data type: ConditionReturn - if not isinstance(v, ConditionReturn): - error_messages.append(f"Error! Input type `{type(v)}` is not `ConditionReturn`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnalysisReturnRelationshipsConditionsInner with oneOf schemas: ConditionReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnalysisReturnRelationshipsConditionsInner with oneOf schemas: ConditionReturn, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationshipsConditionsInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationshipsConditionsInner: - """Returns the object represented by the json string""" - instance = AnalysisReturnRelationshipsConditionsInner.construct() - error_messages = [] - match = 0 - - # deserialize data into ConditionReturn - try: - instance.actual_instance = ConditionReturn.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnalysisReturnRelationshipsConditionsInner with oneOf schemas: ConditionReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnalysisReturnRelationshipsConditionsInner with oneOf schemas: ConditionReturn, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/analysis_return_relationships_images.py b/neurostore_sdk/models/analysis_return_relationships_images.py index 5c26eab..6ef7a2f 100644 --- a/neurostore_sdk/models/analysis_return_relationships_images.py +++ b/neurostore_sdk/models/analysis_return_relationships_images.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.image_return import ImageReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANALYSISRETURNRELATIONSHIPSIMAGES_ONE_OF_SCHEMAS = ["List[ImageReturn]", "List[str]"] @@ -32,16 +31,19 @@ class AnalysisReturnRelationshipsImages(BaseModel): AnalysisReturnRelationshipsImages """ # data type: List[ImageReturn] - oneof_schema_1_validator: Optional[conlist(ImageReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[ImageReturn], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISRETURNRELATIONSHIPSIMAGES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[ImageReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[ImageReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisReturnRelationshipsImages.construct() + instance = AnalysisReturnRelationshipsImages.model_construct() error_messages = [] match = 0 # validate data type: List[ImageReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationshipsImages: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationshipsImages: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnalysisReturnRelationshipsImages.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[ImageReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/analysis_return_relationships_images_inner.py b/neurostore_sdk/models/analysis_return_relationships_images_inner.py deleted file mode 100644 index 0b9ad86..0000000 --- a/neurostore_sdk/models/analysis_return_relationships_images_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.image_return import ImageReturn -from typing import Any, List -from pydantic import StrictStr, Field - -ANALYSISRETURNRELATIONSHIPSIMAGESINNER_ONE_OF_SCHEMAS = ["ImageReturn", "str"] - -class AnalysisReturnRelationshipsImagesInner(BaseModel): - """ - AnalysisReturnRelationshipsImagesInner - """ - # data type: ImageReturn - oneof_schema_1_validator: Optional[ImageReturn] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISRETURNRELATIONSHIPSIMAGESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisReturnRelationshipsImagesInner.construct() - error_messages = [] - match = 0 - # validate data type: ImageReturn - if not isinstance(v, ImageReturn): - error_messages.append(f"Error! Input type `{type(v)}` is not `ImageReturn`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnalysisReturnRelationshipsImagesInner with oneOf schemas: ImageReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnalysisReturnRelationshipsImagesInner with oneOf schemas: ImageReturn, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationshipsImagesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationshipsImagesInner: - """Returns the object represented by the json string""" - instance = AnalysisReturnRelationshipsImagesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into ImageReturn - try: - instance.actual_instance = ImageReturn.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnalysisReturnRelationshipsImagesInner with oneOf schemas: ImageReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnalysisReturnRelationshipsImagesInner with oneOf schemas: ImageReturn, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/analysis_return_relationships_points.py b/neurostore_sdk/models/analysis_return_relationships_points.py index c39a0e7..7f59b24 100644 --- a/neurostore_sdk/models/analysis_return_relationships_points.py +++ b/neurostore_sdk/models/analysis_return_relationships_points.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.point_return import PointReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANALYSISRETURNRELATIONSHIPSPOINTS_ONE_OF_SCHEMAS = ["List[PointReturn]", "List[str]"] @@ -32,16 +31,19 @@ class AnalysisReturnRelationshipsPoints(BaseModel): AnalysisReturnRelationshipsPoints """ # data type: List[PointReturn] - oneof_schema_1_validator: Optional[conlist(PointReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[PointReturn], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISRETURNRELATIONSHIPSPOINTS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[PointReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[PointReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisReturnRelationshipsPoints.construct() + instance = AnalysisReturnRelationshipsPoints.model_construct() error_messages = [] match = 0 # validate data type: List[PointReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationshipsPoints: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationshipsPoints: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnalysisReturnRelationshipsPoints.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[PointReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/analysis_return_relationships_points_inner.py b/neurostore_sdk/models/analysis_return_relationships_points_inner.py deleted file mode 100644 index 8e24c3e..0000000 --- a/neurostore_sdk/models/analysis_return_relationships_points_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.point_return import PointReturn -from typing import Any, List -from pydantic import StrictStr, Field - -ANALYSISRETURNRELATIONSHIPSPOINTSINNER_ONE_OF_SCHEMAS = ["PointReturn", "str"] - -class AnalysisReturnRelationshipsPointsInner(BaseModel): - """ - AnalysisReturnRelationshipsPointsInner - """ - # data type: PointReturn - oneof_schema_1_validator: Optional[PointReturn] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANALYSISRETURNRELATIONSHIPSPOINTSINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnalysisReturnRelationshipsPointsInner.construct() - error_messages = [] - match = 0 - # validate data type: PointReturn - if not isinstance(v, PointReturn): - error_messages.append(f"Error! Input type `{type(v)}` is not `PointReturn`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnalysisReturnRelationshipsPointsInner with oneOf schemas: PointReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnalysisReturnRelationshipsPointsInner with oneOf schemas: PointReturn, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnalysisReturnRelationshipsPointsInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnalysisReturnRelationshipsPointsInner: - """Returns the object represented by the json string""" - instance = AnalysisReturnRelationshipsPointsInner.construct() - error_messages = [] - match = 0 - - # deserialize data into PointReturn - try: - instance.actual_instance = PointReturn.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnalysisReturnRelationshipsPointsInner with oneOf schemas: PointReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnalysisReturnRelationshipsPointsInner with oneOf schemas: PointReturn, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/annotation_base.py b/neurostore_sdk/models/annotation_base.py index 7c8bfbd..464035c 100644 --- a/neurostore_sdk/models/annotation_base.py +++ b/neurostore_sdk/models/annotation_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,76 +18,92 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class AnnotationBase(BaseModel): """ AnnotationBase - """ - name: Optional[StrictStr] = Field(None, description="Descriptive name for the annotation.") - description: Optional[StrictStr] = Field(None, description="Long form description of the annotation.") - metadata: Optional[Dict[str, Any]] = Field(None, description="object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation.") - note_keys: Optional[Dict[str, Any]] = Field(None, description="The keys (columns) in the annotation and the key's respective data type (such as an integer or string).") - __properties = ["name", "description", "metadata", "note_keys"] + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Descriptive name for the annotation.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the annotation.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation.") + note_keys: Optional[Dict[str, Any]] = Field(default=None, description="The keys (columns) in the annotation and the key's respective data type (such as an integer or string).") + __properties: ClassVar[List[str]] = ["name", "description", "metadata", "note_keys"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if note_keys (nullable) is None - # and __fields_set__ contains the field - if self.note_keys is None and "note_keys" in self.__fields_set__: + # and model_fields_set contains the field + if self.note_keys is None and "note_keys" in self.model_fields_set: _dict['note_keys'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationBase.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "metadata": obj.get("metadata"), @@ -95,3 +111,4 @@ def from_dict(cls, obj: dict) -> AnnotationBase: }) return _obj + diff --git a/neurostore_sdk/models/annotation_common.py b/neurostore_sdk/models/annotation_common.py index 27b9a4d..f721d13 100644 --- a/neurostore_sdk/models/annotation_common.py +++ b/neurostore_sdk/models/annotation_common.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,54 +18,71 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class AnnotationCommon(BaseModel): """ AnnotationCommon - """ + """ # noqa: E501 studyset: Optional[StrictStr] = None - __properties = ["studyset"] + __properties: ClassVar[List[str]] = ["studyset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationCommon: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationCommon 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationCommon: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationCommon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationCommon.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationCommon.parse_obj({ + _obj = cls.model_validate({ "studyset": obj.get("studyset") }) return _obj + diff --git a/neurostore_sdk/models/annotation_export.py b/neurostore_sdk/models/annotation_export.py index 0891804..afd4e84 100644 --- a/neurostore_sdk/models/annotation_export.py +++ b/neurostore_sdk/models/annotation_export.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,62 +18,80 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class AnnotationExport(BaseModel): """ exporting an annotation as a CSV for easier editing - """ + """ # noqa: E501 metadata: Optional[Dict[str, Any]] = None - annotation_csv: StrictStr = Field(..., description="annotation object expressed as a CSV") - __properties = ["metadata", "annotation_csv"] + annotation_csv: StrictStr = Field(description="annotation object expressed as a CSV") + __properties: ClassVar[List[str]] = ["metadata", "annotation_csv"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationExport: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationExport 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={ - "metadata", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "metadata", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationExport: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationExport from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationExport.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationExport.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), "annotation_csv": obj.get("annotation_csv") }) return _obj + diff --git a/neurostore_sdk/models/annotation_list.py b/neurostore_sdk/models/annotation_list.py index bb3d259..58ef54a 100644 --- a/neurostore_sdk/models/annotation_list.py +++ b/neurostore_sdk/models/annotation_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.annotation_return import AnnotationReturn -from neurostore_sdk.models.metadata import Metadata +from typing import Optional, Set +from typing_extensions import Self class AnnotationList(BaseModel): """ AnnotationList - """ - results: Optional[conlist(AnnotationReturn)] = None + """ # noqa: E501 + results: Optional[List[AnnotationReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationList.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationList.parse_obj({ - "results": [AnnotationReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [AnnotationReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/annotation_request.py b/neurostore_sdk/models/annotation_request.py index 4b9d1d5..b56075d 100644 --- a/neurostore_sdk/models/annotation_request.py +++ b/neurostore_sdk/models/annotation_request.py @@ -3,28 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from neurostore_sdk.models.annotation_request_one_of import AnnotationRequestOneOf from neurostore_sdk.models.annotation_return_one_of import AnnotationReturnOneOf -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANNOTATIONREQUEST_ONE_OF_SCHEMAS = ["AnnotationRequestOneOf", "AnnotationReturnOneOf"] @@ -36,13 +34,16 @@ class AnnotationRequest(BaseModel): oneof_schema_1_validator: Optional[AnnotationReturnOneOf] = None # data type: AnnotationRequestOneOf oneof_schema_2_validator: Optional[AnnotationRequestOneOf] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANNOTATIONREQUEST_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[AnnotationRequestOneOf, AnnotationReturnOneOf]] = None + one_of_schemas: Set[str] = { "AnnotationRequestOneOf", "AnnotationReturnOneOf" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -52,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnnotationRequest.construct() + instance = AnnotationRequest.model_construct() error_messages = [] match = 0 # validate data type: AnnotationReturnOneOf @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnnotationRequest: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnnotationRequest: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnnotationRequest.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -114,19 +115,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], AnnotationRequestOneOf, AnnotationReturnOneOf]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -134,5 +133,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/annotation_request_one_of.py b/neurostore_sdk/models/annotation_request_one_of.py index c652459..f892435 100644 --- a/neurostore_sdk/models/annotation_request_one_of.py +++ b/neurostore_sdk/models/annotation_request_one_of.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,92 +18,110 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.annotation_request_relationships_notes import AnnotationRequestRelationshipsNotes +from typing import Optional, Set +from typing_extensions import Self class AnnotationRequestOneOf(BaseModel): """ AnnotationRequestOneOf - """ - name: Optional[StrictStr] = Field(None, description="Descriptive name for the annotation.") - description: Optional[StrictStr] = Field(None, description="Long form description of the annotation.") - metadata: Optional[Dict[str, Any]] = Field(None, description="object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation.") - note_keys: Optional[Dict[str, Any]] = Field(None, description="The keys (columns) in the annotation and the key's respective data type (such as an integer or string).") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Descriptive name for the annotation.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the annotation.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation.") + note_keys: Optional[Dict[str, Any]] = Field(default=None, description="The keys (columns) in the annotation and the key's respective data type (such as an integer or string).") notes: Optional[AnnotationRequestRelationshipsNotes] = None - id: Optional[constr(strict=True, max_length=30, 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") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") studyset: Optional[StrictStr] = None - __properties = ["name", "description", "metadata", "note_keys", "notes", "id", "public", "studyset"] + __properties: ClassVar[List[str]] = ["name", "description", "metadata", "note_keys", "notes", "id", "public", "studyset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationRequestOneOf: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationRequestOneOf 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of notes if self.notes: _dict['notes'] = self.notes.to_dict() # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if note_keys (nullable) is None - # and __fields_set__ contains the field - if self.note_keys is None and "note_keys" in self.__fields_set__: + # and model_fields_set contains the field + if self.note_keys is None and "note_keys" in self.model_fields_set: _dict['note_keys'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationRequestOneOf: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationRequestOneOf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationRequestOneOf.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationRequestOneOf.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "metadata": obj.get("metadata"), "note_keys": obj.get("note_keys"), - "notes": AnnotationRequestRelationshipsNotes.from_dict(obj.get("notes")) if obj.get("notes") is not None else None, + "notes": AnnotationRequestRelationshipsNotes.from_dict(obj["notes"]) if obj.get("notes") is not None else None, "id": obj.get("id"), "public": obj.get("public") if obj.get("public") is not None else True, "studyset": obj.get("studyset") }) return _obj + diff --git a/neurostore_sdk/models/annotation_request_relationships.py b/neurostore_sdk/models/annotation_request_relationships.py index 05c6121..7f7b862 100644 --- a/neurostore_sdk/models/annotation_request_relationships.py +++ b/neurostore_sdk/models/annotation_request_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.annotation_request_relationships_notes import AnnotationRequestRelationshipsNotes +from typing import Optional, Set +from typing_extensions import Self class AnnotationRequestRelationships(BaseModel): """ AnnotationRequestRelationships - """ + """ # noqa: E501 notes: Optional[AnnotationRequestRelationshipsNotes] = None - __properties = ["notes"] + __properties: ClassVar[List[str]] = ["notes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationRequestRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationRequestRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of notes if self.notes: _dict['notes'] = self.notes.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationRequestRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationRequestRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationRequestRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationRequestRelationships.parse_obj({ - "notes": AnnotationRequestRelationshipsNotes.from_dict(obj.get("notes")) if obj.get("notes") is not None else None + _obj = cls.model_validate({ + "notes": AnnotationRequestRelationshipsNotes.from_dict(obj["notes"]) if obj.get("notes") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/annotation_request_relationships_notes.py b/neurostore_sdk/models/annotation_request_relationships_notes.py index 91ec47a..2543279 100644 --- a/neurostore_sdk/models/annotation_request_relationships_notes.py +++ b/neurostore_sdk/models/annotation_request_relationships_notes.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.note_collection_request import NoteCollectionRequest -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANNOTATIONREQUESTRELATIONSHIPSNOTES_ONE_OF_SCHEMAS = ["List[NoteCollectionRequest]", "List[str]"] @@ -32,16 +31,19 @@ class AnnotationRequestRelationshipsNotes(BaseModel): AnnotationRequestRelationshipsNotes """ # data type: List[NoteCollectionRequest] - oneof_schema_1_validator: Optional[conlist(NoteCollectionRequest, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[NoteCollectionRequest], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANNOTATIONREQUESTRELATIONSHIPSNOTES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[NoteCollectionRequest], List[str]]] = None + one_of_schemas: Set[str] = { "List[NoteCollectionRequest]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnnotationRequestRelationshipsNotes.construct() + instance = AnnotationRequestRelationshipsNotes.model_construct() error_messages = [] match = 0 # validate data type: List[NoteCollectionRequest] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnnotationRequestRelationshipsNotes: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnnotationRequestRelationshipsNotes: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnnotationRequestRelationshipsNotes.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[NoteCollectionRequest], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/annotation_request_relationships_notes_inner.py b/neurostore_sdk/models/annotation_request_relationships_notes_inner.py deleted file mode 100644 index e95d536..0000000 --- a/neurostore_sdk/models/annotation_request_relationships_notes_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.note_collection_request import NoteCollectionRequest -from typing import Any, List -from pydantic import StrictStr, Field - -ANNOTATIONREQUESTRELATIONSHIPSNOTESINNER_ONE_OF_SCHEMAS = ["NoteCollectionRequest", "str"] - -class AnnotationRequestRelationshipsNotesInner(BaseModel): - """ - AnnotationRequestRelationshipsNotesInner - """ - # data type: NoteCollectionRequest - oneof_schema_1_validator: Optional[NoteCollectionRequest] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANNOTATIONREQUESTRELATIONSHIPSNOTESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnnotationRequestRelationshipsNotesInner.construct() - error_messages = [] - match = 0 - # validate data type: NoteCollectionRequest - if not isinstance(v, NoteCollectionRequest): - error_messages.append(f"Error! Input type `{type(v)}` is not `NoteCollectionRequest`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnnotationRequestRelationshipsNotesInner with oneOf schemas: NoteCollectionRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnnotationRequestRelationshipsNotesInner with oneOf schemas: NoteCollectionRequest, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnnotationRequestRelationshipsNotesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnnotationRequestRelationshipsNotesInner: - """Returns the object represented by the json string""" - instance = AnnotationRequestRelationshipsNotesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into NoteCollectionRequest - try: - instance.actual_instance = NoteCollectionRequest.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnnotationRequestRelationshipsNotesInner with oneOf schemas: NoteCollectionRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnnotationRequestRelationshipsNotesInner with oneOf schemas: NoteCollectionRequest, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/annotation_return.py b/neurostore_sdk/models/annotation_return.py index 2641201..536fafd 100644 --- a/neurostore_sdk/models/annotation_return.py +++ b/neurostore_sdk/models/annotation_return.py @@ -3,28 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator from neurostore_sdk.models.annotation_return_one_of import AnnotationReturnOneOf from neurostore_sdk.models.annotation_return_one_of1 import AnnotationReturnOneOf1 -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANNOTATIONRETURN_ONE_OF_SCHEMAS = ["AnnotationReturnOneOf", "AnnotationReturnOneOf1"] @@ -36,13 +34,16 @@ class AnnotationReturn(BaseModel): oneof_schema_1_validator: Optional[AnnotationReturnOneOf] = None # data type: AnnotationReturnOneOf1 oneof_schema_2_validator: Optional[AnnotationReturnOneOf1] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANNOTATIONRETURN_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[AnnotationReturnOneOf, AnnotationReturnOneOf1]] = None + one_of_schemas: Set[str] = { "AnnotationReturnOneOf", "AnnotationReturnOneOf1" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -52,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnnotationReturn.construct() + instance = AnnotationReturn.model_construct() error_messages = [] match = 0 # validate data type: AnnotationReturnOneOf @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnnotationReturn: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnnotationReturn: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnnotationReturn.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -114,19 +115,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], AnnotationReturnOneOf, AnnotationReturnOneOf1]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -134,5 +133,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/annotation_return_one_of.py b/neurostore_sdk/models/annotation_return_one_of.py index e9436cc..59ece0b 100644 --- a/neurostore_sdk/models/annotation_return_one_of.py +++ b/neurostore_sdk/models/annotation_return_one_of.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,62 +18,80 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class AnnotationReturnOneOf(BaseModel): """ AnnotationReturnOneOf - """ + """ # noqa: E501 metadata: Optional[Dict[str, Any]] = None - annotation_csv: StrictStr = Field(..., description="annotation object expressed as a CSV") - __properties = ["metadata", "annotation_csv"] + annotation_csv: StrictStr = Field(description="annotation object expressed as a CSV") + __properties: ClassVar[List[str]] = ["metadata", "annotation_csv"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationReturnOneOf: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationReturnOneOf 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={ - "metadata", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "metadata", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationReturnOneOf: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationReturnOneOf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationReturnOneOf.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationReturnOneOf.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), "annotation_csv": obj.get("annotation_csv") }) return _obj + diff --git a/neurostore_sdk/models/annotation_return_one_of1.py b/neurostore_sdk/models/annotation_return_one_of1.py index 032a7a9..82f66ff 100644 --- a/neurostore_sdk/models/annotation_return_one_of1.py +++ b/neurostore_sdk/models/annotation_return_one_of1.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,124 +19,146 @@ import json from datetime import datetime -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.annotation_return_relationships_notes import AnnotationReturnRelationshipsNotes +from typing import Optional, Set +from typing_extensions import Self class AnnotationReturnOneOf1(BaseModel): """ AnnotationReturnOneOf1 - """ - name: Optional[StrictStr] = Field(None, description="Descriptive name for the annotation.") - description: Optional[StrictStr] = Field(None, description="Long form description of the annotation.") - metadata: Optional[Dict[str, Any]] = Field(None, description="object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation.") - note_keys: Optional[Dict[str, Any]] = Field(None, description="The keys (columns) in the annotation and the key's respective data type (such as an integer or string).") - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Descriptive name for the annotation.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the annotation.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="object describing metadata about the annotation, such as software used or descriptions of the keys used in the annotation.") + note_keys: Optional[Dict[str, Any]] = Field(default=None, description="The keys (columns) in the annotation and the key's respective data type (such as an integer or string).") + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") source: Optional[StrictStr] = None source_id: Optional[StrictStr] = None source_updated_at: Optional[StrictStr] = None notes: Optional[AnnotationReturnRelationshipsNotes] = None studyset: Optional[StrictStr] = None - __properties = ["name", "description", "metadata", "note_keys", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "notes", "studyset"] + __properties: ClassVar[List[str]] = ["name", "description", "metadata", "note_keys", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "notes", "studyset"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationReturnOneOf1: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationReturnOneOf1 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={ - "created_at", - "updated_at", - "user", - "source_updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + "source_updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of notes if self.notes: _dict['notes'] = self.notes.to_dict() # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if note_keys (nullable) is None - # and __fields_set__ contains the field - if self.note_keys is None and "note_keys" in self.__fields_set__: + # and model_fields_set contains the field + if self.note_keys is None and "note_keys" in self.model_fields_set: _dict['note_keys'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_id (nullable) is None - # and __fields_set__ contains the field - if self.source_id is None and "source_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_id is None and "source_id" in self.model_fields_set: _dict['source_id'] = None # set to None if source_updated_at (nullable) is None - # and __fields_set__ contains the field - if self.source_updated_at is None and "source_updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_updated_at is None and "source_updated_at" in self.model_fields_set: _dict['source_updated_at'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationReturnOneOf1: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationReturnOneOf1 from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationReturnOneOf1.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationReturnOneOf1.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "metadata": obj.get("metadata"), @@ -150,8 +172,9 @@ def from_dict(cls, obj: dict) -> AnnotationReturnOneOf1: "source": obj.get("source"), "source_id": obj.get("source_id"), "source_updated_at": obj.get("source_updated_at"), - "notes": AnnotationReturnRelationshipsNotes.from_dict(obj.get("notes")) if obj.get("notes") is not None else None, + "notes": AnnotationReturnRelationshipsNotes.from_dict(obj["notes"]) if obj.get("notes") is not None else None, "studyset": obj.get("studyset") }) return _obj + diff --git a/neurostore_sdk/models/annotation_return_relationships.py b/neurostore_sdk/models/annotation_return_relationships.py index f12957a..9ea2b5d 100644 --- a/neurostore_sdk/models/annotation_return_relationships.py +++ b/neurostore_sdk/models/annotation_return_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.annotation_return_relationships_notes import AnnotationReturnRelationshipsNotes +from typing import Optional, Set +from typing_extensions import Self class AnnotationReturnRelationships(BaseModel): """ AnnotationReturnRelationships - """ + """ # noqa: E501 notes: Optional[AnnotationReturnRelationshipsNotes] = None - __properties = ["notes"] + __properties: ClassVar[List[str]] = ["notes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AnnotationReturnRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationReturnRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of notes if self.notes: _dict['notes'] = self.notes.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationReturnRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationReturnRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationReturnRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationReturnRelationships.parse_obj({ - "notes": AnnotationReturnRelationshipsNotes.from_dict(obj.get("notes")) if obj.get("notes") is not None else None + _obj = cls.model_validate({ + "notes": AnnotationReturnRelationshipsNotes.from_dict(obj["notes"]) if obj.get("notes") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/annotation_return_relationships_notes.py b/neurostore_sdk/models/annotation_return_relationships_notes.py index 49e7618..8130e51 100644 --- a/neurostore_sdk/models/annotation_return_relationships_notes.py +++ b/neurostore_sdk/models/annotation_return_relationships_notes.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.note_collection_return import NoteCollectionReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self ANNOTATIONRETURNRELATIONSHIPSNOTES_ONE_OF_SCHEMAS = ["List[NoteCollectionReturn]", "List[str]"] @@ -32,16 +31,19 @@ class AnnotationReturnRelationshipsNotes(BaseModel): AnnotationReturnRelationshipsNotes """ # data type: List[NoteCollectionReturn] - oneof_schema_1_validator: Optional[conlist(NoteCollectionReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[NoteCollectionReturn], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANNOTATIONRETURNRELATIONSHIPSNOTES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[NoteCollectionReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[NoteCollectionReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = AnnotationReturnRelationshipsNotes.construct() + instance = AnnotationReturnRelationshipsNotes.model_construct() error_messages = [] match = 0 # validate data type: List[NoteCollectionReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> AnnotationReturnRelationshipsNotes: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> AnnotationReturnRelationshipsNotes: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = AnnotationReturnRelationshipsNotes.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[NoteCollectionReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/annotation_return_relationships_notes_inner.py b/neurostore_sdk/models/annotation_return_relationships_notes_inner.py deleted file mode 100644 index 4526905..0000000 --- a/neurostore_sdk/models/annotation_return_relationships_notes_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.note_collection_return import NoteCollectionReturn -from typing import Any, List -from pydantic import StrictStr, Field - -ANNOTATIONRETURNRELATIONSHIPSNOTESINNER_ONE_OF_SCHEMAS = ["NoteCollectionReturn", "str"] - -class AnnotationReturnRelationshipsNotesInner(BaseModel): - """ - AnnotationReturnRelationshipsNotesInner - """ - # data type: NoteCollectionReturn - oneof_schema_1_validator: Optional[NoteCollectionReturn] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(ANNOTATIONRETURNRELATIONSHIPSNOTESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = AnnotationReturnRelationshipsNotesInner.construct() - error_messages = [] - match = 0 - # validate data type: NoteCollectionReturn - if not isinstance(v, NoteCollectionReturn): - error_messages.append(f"Error! Input type `{type(v)}` is not `NoteCollectionReturn`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in AnnotationReturnRelationshipsNotesInner with oneOf schemas: NoteCollectionReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in AnnotationReturnRelationshipsNotesInner with oneOf schemas: NoteCollectionReturn, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> AnnotationReturnRelationshipsNotesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> AnnotationReturnRelationshipsNotesInner: - """Returns the object represented by the json string""" - instance = AnnotationReturnRelationshipsNotesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into NoteCollectionReturn - try: - instance.actual_instance = NoteCollectionReturn.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into AnnotationReturnRelationshipsNotesInner with oneOf schemas: NoteCollectionReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into AnnotationReturnRelationshipsNotesInner with oneOf schemas: NoteCollectionReturn, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/base_studies_post200_response.py b/neurostore_sdk/models/base_studies_post200_response.py index 2d82586..d8a303f 100644 --- a/neurostore_sdk/models/base_studies_post200_response.py +++ b/neurostore_sdk/models/base_studies_post200_response.py @@ -3,27 +3,25 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator from neurostore_sdk.models.base_study_return import BaseStudyReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self BASESTUDIESPOST200RESPONSE_ONE_OF_SCHEMAS = ["BaseStudyReturn", "List[BaseStudyReturn]"] @@ -34,14 +32,17 @@ class BaseStudiesPost200Response(BaseModel): # data type: BaseStudyReturn oneof_schema_1_validator: Optional[BaseStudyReturn] = None # data type: List[BaseStudyReturn] - oneof_schema_2_validator: Optional[conlist(BaseStudyReturn)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(BASESTUDIESPOST200RESPONSE_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[BaseStudyReturn]] = None + actual_instance: Optional[Union[BaseStudyReturn, List[BaseStudyReturn]]] = None + one_of_schemas: Set[str] = { "BaseStudyReturn", "List[BaseStudyReturn]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +52,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = BaseStudiesPost200Response.construct() + instance = BaseStudiesPost200Response.model_construct() error_messages = [] match = 0 # validate data type: BaseStudyReturn @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> BaseStudiesPost200Response: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> BaseStudiesPost200Response: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = BaseStudiesPost200Response.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -117,19 +118,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], BaseStudyReturn, List[BaseStudyReturn]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -137,5 +136,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/base_studies_post_request.py b/neurostore_sdk/models/base_studies_post_request.py index ad0044d..50149f4 100644 --- a/neurostore_sdk/models/base_studies_post_request.py +++ b/neurostore_sdk/models/base_studies_post_request.py @@ -3,27 +3,25 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator from neurostore_sdk.models.base_study import BaseStudy -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self BASESTUDIESPOSTREQUEST_ONE_OF_SCHEMAS = ["BaseStudy", "List[BaseStudy]"] @@ -34,14 +32,17 @@ class BaseStudiesPostRequest(BaseModel): # data type: BaseStudy oneof_schema_1_validator: Optional[BaseStudy] = None # data type: List[BaseStudy] - oneof_schema_2_validator: Optional[conlist(BaseStudy)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(BASESTUDIESPOSTREQUEST_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[BaseStudy]] = None + actual_instance: Optional[Union[BaseStudy, List[BaseStudy]]] = None + one_of_schemas: Set[str] = { "BaseStudy", "List[BaseStudy]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +52,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = BaseStudiesPostRequest.construct() + instance = BaseStudiesPostRequest.model_construct() error_messages = [] match = 0 # validate data type: BaseStudy @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> BaseStudiesPostRequest: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> BaseStudiesPostRequest: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = BaseStudiesPostRequest.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -117,19 +118,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], BaseStudy, List[BaseStudy]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -137,5 +136,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/base_study.py b/neurostore_sdk/models/base_study.py index 2f0d1ad..0ddb732 100644 --- a/neurostore_sdk/models/base_study.py +++ b/neurostore_sdk/models/base_study.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,15 +18,16 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.base_study_versions import BaseStudyVersions +from typing import Optional, Set +from typing_extensions import Self class BaseStudy(BaseModel): """ BaseStudy - """ + """ # noqa: E501 metadata: Optional[Dict[str, Any]] = None versions: Optional[BaseStudyVersions] = None name: Optional[StrictStr] = None @@ -38,99 +39,114 @@ class BaseStudy(BaseModel): year: Optional[StrictInt] = None level: Optional[StrictStr] = None pmcid: Optional[StrictStr] = None - __properties = ["metadata", "versions", "name", "description", "publication", "doi", "pmid", "authors", "year", "level", "pmcid"] + __properties: ClassVar[List[str]] = ["metadata", "versions", "name", "description", "publication", "doi", "pmid", "authors", "year", "level", "pmcid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> BaseStudy: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of BaseStudy 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of versions if self.versions: _dict['versions'] = self.versions.to_dict() # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: + # and model_fields_set contains the field + if self.authors is None and "authors" in self.model_fields_set: _dict['authors'] = None # set to None if year (nullable) is None - # and __fields_set__ contains the field - if self.year is None and "year" in self.__fields_set__: + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: _dict['year'] = None # set to None if level (nullable) is None - # and __fields_set__ contains the field - if self.level is None and "level" in self.__fields_set__: + # and model_fields_set contains the field + if self.level is None and "level" in self.model_fields_set: _dict['level'] = 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__: + # and model_fields_set contains the field + if self.pmcid is None and "pmcid" in self.model_fields_set: _dict['pmcid'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> BaseStudy: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of BaseStudy from a dict""" if obj is None: return None if not isinstance(obj, dict): - return BaseStudy.parse_obj(obj) + return cls.model_validate(obj) - _obj = BaseStudy.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), - "versions": BaseStudyVersions.from_dict(obj.get("versions")) if obj.get("versions") is not None else None, + "versions": BaseStudyVersions.from_dict(obj["versions"]) if obj.get("versions") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "publication": obj.get("publication"), @@ -143,3 +159,4 @@ def from_dict(cls, obj: dict) -> BaseStudy: }) return _obj + diff --git a/neurostore_sdk/models/base_study_list.py b/neurostore_sdk/models/base_study_list.py index bbbdb56..6de3ad5 100644 --- a/neurostore_sdk/models/base_study_list.py +++ b/neurostore_sdk/models/base_study_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.base_study_return import BaseStudyReturn -from neurostore_sdk.models.metadata import Metadata +from typing import Optional, Set +from typing_extensions import Self class BaseStudyList(BaseModel): """ BaseStudyList - """ - results: Optional[conlist(BaseStudyReturn)] = None + """ # noqa: E501 + results: Optional[List[BaseStudyReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> BaseStudyList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of BaseStudyList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> BaseStudyList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of BaseStudyList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return BaseStudyList.parse_obj(obj) + return cls.model_validate(obj) - _obj = BaseStudyList.parse_obj({ - "results": [BaseStudyReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [BaseStudyReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/base_study_return.py b/neurostore_sdk/models/base_study_return.py index fcf8b88..ecc0082 100644 --- a/neurostore_sdk/models/base_study_return.py +++ b/neurostore_sdk/models/base_study_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,14 +19,17 @@ import json from datetime import datetime -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.base_study_versions import BaseStudyVersions +from typing import Optional, Set +from typing_extensions import Self class BaseStudyReturn(BaseModel): """ BaseStudyReturn - """ + """ # noqa: E501 metadata: Optional[Dict[str, Any]] = None versions: Optional[BaseStudyVersions] = None name: Optional[StrictStr] = None @@ -38,123 +41,141 @@ class BaseStudyReturn(BaseModel): year: Optional[StrictInt] = None level: Optional[StrictStr] = None pmcid: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") - __properties = ["metadata", "versions", "name", "description", "publication", "doi", "pmid", "authors", "year", "level", "pmcid", "created_at", "updated_at", "id", "public", "user", "username"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") + __properties: ClassVar[List[str]] = ["metadata", "versions", "name", "description", "publication", "doi", "pmid", "authors", "year", "level", "pmcid", "created_at", "updated_at", "id", "public", "user", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> BaseStudyReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of BaseStudyReturn 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={ - "created_at", - "updated_at", - "user", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of versions if self.versions: _dict['versions'] = self.versions.to_dict() # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: + # and model_fields_set contains the field + if self.authors is None and "authors" in self.model_fields_set: _dict['authors'] = None # set to None if year (nullable) is None - # and __fields_set__ contains the field - if self.year is None and "year" in self.__fields_set__: + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: _dict['year'] = None # set to None if level (nullable) is None - # and __fields_set__ contains the field - if self.level is None and "level" in self.__fields_set__: + # and model_fields_set contains the field + if self.level is None and "level" in self.model_fields_set: _dict['level'] = 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__: + # and model_fields_set contains the field + if self.pmcid is None and "pmcid" in self.model_fields_set: _dict['pmcid'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> BaseStudyReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of BaseStudyReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return BaseStudyReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = BaseStudyReturn.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), - "versions": BaseStudyVersions.from_dict(obj.get("versions")) if obj.get("versions") is not None else None, + "versions": BaseStudyVersions.from_dict(obj["versions"]) if obj.get("versions") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "publication": obj.get("publication"), @@ -173,3 +194,4 @@ def from_dict(cls, obj: dict) -> BaseStudyReturn: }) return _obj + diff --git a/neurostore_sdk/models/base_study_versions.py b/neurostore_sdk/models/base_study_versions.py index af3e08b..7c5df3a 100644 --- a/neurostore_sdk/models/base_study_versions.py +++ b/neurostore_sdk/models/base_study_versions.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, constr, validator +from typing_extensions import Annotated from neurostore_sdk.models.study_return import StudyReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self BASESTUDYVERSIONS_ONE_OF_SCHEMAS = ["List[StudyReturn]", "List[str]"] @@ -32,16 +31,19 @@ class BaseStudyVersions(BaseModel): BaseStudyVersions """ # data type: List[str] - oneof_schema_1_validator: Optional[conlist(constr(strict=True))] = None + oneof_schema_1_validator: Optional[List[Annotated[str, Field(strict=True)]]] = None # data type: List[StudyReturn] - oneof_schema_2_validator: Optional[conlist(StudyReturn)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(BASESTUDYVERSIONS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StudyReturn]] = None + actual_instance: Optional[Union[List[StudyReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[StudyReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = BaseStudyVersions.construct() + instance = BaseStudyVersions.model_construct() error_messages = [] match = 0 # validate data type: List[str] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> BaseStudyVersions: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> BaseStudyVersions: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = BaseStudyVersions.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[StudyReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/clone.py b/neurostore_sdk/models/clone.py index d4077bd..f88fb2a 100644 --- a/neurostore_sdk/models/clone.py +++ b/neurostore_sdk/models/clone.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,74 +18,92 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Clone(BaseModel): """ Clone - """ + """ # noqa: E501 source: Optional[StrictStr] = None source_id: Optional[StrictStr] = None source_updated_at: Optional[StrictStr] = None - __properties = ["source", "source_id", "source_updated_at"] + __properties: ClassVar[List[str]] = ["source", "source_id", "source_updated_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Clone: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Clone 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={ - "source_updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "source_updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_id (nullable) is None - # and __fields_set__ contains the field - if self.source_id is None and "source_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_id is None and "source_id" in self.model_fields_set: _dict['source_id'] = None # set to None if source_updated_at (nullable) is None - # and __fields_set__ contains the field - if self.source_updated_at is None and "source_updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_updated_at is None and "source_updated_at" in self.model_fields_set: _dict['source_updated_at'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Clone: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Clone from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Clone.parse_obj(obj) + return cls.model_validate(obj) - _obj = Clone.parse_obj({ + _obj = cls.model_validate({ "source": obj.get("source"), "source_id": obj.get("source_id"), "source_updated_at": obj.get("source_updated_at") }) return _obj + diff --git a/neurostore_sdk/models/condition_base.py b/neurostore_sdk/models/condition_base.py index aa2c51c..d4b69d6 100644 --- a/neurostore_sdk/models/condition_base.py +++ b/neurostore_sdk/models/condition_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,66 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ConditionBase(BaseModel): """ ConditionBase - """ - name: Optional[StrictStr] = Field(None, description="Name of the condition being applied in the contrast, either psychological, pharmacological, or group based.") - description: Optional[StrictStr] = Field(None, description="Long form description of how the condition is operationalized and/or specific meaning.") - __properties = ["name", "description"] + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the condition being applied in the contrast, either psychological, pharmacological, or group based.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of how the condition is operationalized and/or specific meaning.") + __properties: ClassVar[List[str]] = ["name", "description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ConditionBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ConditionBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ConditionBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ConditionBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ConditionBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = ConditionBase.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description") }) return _obj + diff --git a/neurostore_sdk/models/condition_list.py b/neurostore_sdk/models/condition_list.py index 8d1f9bb..a5ee0c0 100644 --- a/neurostore_sdk/models/condition_list.py +++ b/neurostore_sdk/models/condition_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.condition_return import ConditionReturn -from neurostore_sdk.models.metadata import Metadata +from typing import Optional, Set +from typing_extensions import Self class ConditionList(BaseModel): """ ConditionList - """ - results: Optional[conlist(ConditionReturn)] = None + """ # noqa: E501 + results: Optional[List[ConditionReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ConditionList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ConditionList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ConditionList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ConditionList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ConditionList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ConditionList.parse_obj({ - "results": [ConditionReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [ConditionReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/condition_request.py b/neurostore_sdk/models/condition_request.py index 8b865be..31d691c 100644 --- a/neurostore_sdk/models/condition_request.py +++ b/neurostore_sdk/models/condition_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,66 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ConditionRequest(BaseModel): """ ConditionRequest - """ - name: Optional[StrictStr] = Field(None, description="Name of the condition being applied in the contrast, either psychological, pharmacological, or group based.") - description: Optional[StrictStr] = Field(None, description="Long form description of how the condition is operationalized and/or specific meaning.") - id: Optional[constr(strict=True, max_length=30, 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 = ["name", "description", "id", "public"] + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the condition being applied in the contrast, either psychological, pharmacological, or group based.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of how the condition is operationalized and/or specific meaning.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + __properties: ClassVar[List[str]] = ["name", "description", "id", "public"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ConditionRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ConditionRequest 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ConditionRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ConditionRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ConditionRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = ConditionRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "id": obj.get("id"), @@ -85,3 +102,4 @@ def from_dict(cls, obj: dict) -> ConditionRequest: }) return _obj + diff --git a/neurostore_sdk/models/condition_return.py b/neurostore_sdk/models/condition_return.py index cf50c36..b876a7b 100644 --- a/neurostore_sdk/models/condition_return.py +++ b/neurostore_sdk/models/condition_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,87 +19,108 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ConditionReturn(BaseModel): """ ConditionReturn - """ - name: Optional[StrictStr] = Field(None, description="Name of the condition being applied in the contrast, either psychological, pharmacological, or group based.") - description: Optional[StrictStr] = Field(None, description="Long form description of how the condition is operationalized and/or specific meaning.") - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") - __properties = ["name", "description", "created_at", "updated_at", "id", "public", "user", "username"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Name of the condition being applied in the contrast, either psychological, pharmacological, or group based.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of how the condition is operationalized and/or specific meaning.") + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") + __properties: ClassVar[List[str]] = ["name", "description", "created_at", "updated_at", "id", "public", "user", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ConditionReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ConditionReturn 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={ - "created_at", - "updated_at", - "user", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ConditionReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ConditionReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ConditionReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = ConditionReturn.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "created_at": obj.get("created_at"), @@ -111,3 +132,4 @@ def from_dict(cls, obj: dict) -> ConditionReturn: }) return _obj + diff --git a/neurostore_sdk/models/entity.py b/neurostore_sdk/models/entity.py index c6520d9..617d4e3 100644 --- a/neurostore_sdk/models/entity.py +++ b/neurostore_sdk/models/entity.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,73 +18,90 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class Entity(BaseModel): """ WARNING: not currently used. descriptor of level of analysis for a particular image/point (run, session, subject, group, meta) - """ + """ # noqa: E501 label: Optional[StrictStr] = None level: Optional[StrictStr] = None analysis: Optional[StrictStr] = None - __properties = ["label", "level", "analysis"] + __properties: ClassVar[List[str]] = ["label", "level", "analysis"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Entity: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Entity 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if label (nullable) is None - # and __fields_set__ contains the field - if self.label is None and "label" in self.__fields_set__: + # and model_fields_set contains the field + if self.label is None and "label" in self.model_fields_set: _dict['label'] = None # set to None if level (nullable) is None - # and __fields_set__ contains the field - if self.level is None and "level" in self.__fields_set__: + # and model_fields_set contains the field + if self.level is None and "level" in self.model_fields_set: _dict['level'] = None # set to None if analysis (nullable) is None - # and __fields_set__ contains the field - if self.analysis is None and "analysis" in self.__fields_set__: + # and model_fields_set contains the field + if self.analysis is None and "analysis" in self.model_fields_set: _dict['analysis'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Entity: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Entity from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Entity.parse_obj(obj) + return cls.model_validate(obj) - _obj = Entity.parse_obj({ + _obj = cls.model_validate({ "label": obj.get("label"), "level": obj.get("level"), "analysis": obj.get("analysis") }) return _obj + diff --git a/neurostore_sdk/models/entity_all_of.py b/neurostore_sdk/models/entity_all_of.py deleted file mode 100644 index b1d9bd0..0000000 --- a/neurostore_sdk/models/entity_all_of.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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, validator - -class EntityAllOf(BaseModel): - """ - EntityAllOf - """ - label: Optional[StrictStr] = None - level: Optional[StrictStr] = None - analysis: Optional[StrictStr] = None - __properties = ["label", "level", "analysis"] - - @validator('level') - def level_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('run', 'session', 'subject', 'group', 'meta'): - raise ValueError("must be one of enum values ('run', 'session', 'subject', 'group', 'meta')") - return value - - 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) -> EntityAllOf: - """Create an instance of EntityAllOf 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) - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> EntityAllOf: - """Create an instance of EntityAllOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return EntityAllOf.parse_obj(obj) - - _obj = EntityAllOf.parse_obj({ - "label": obj.get("label"), - "level": obj.get("level"), - "analysis": obj.get("analysis") - }) - return _obj - diff --git a/neurostore_sdk/models/image_base.py b/neurostore_sdk/models/image_base.py index e6bbb4e..6922edc 100644 --- a/neurostore_sdk/models/image_base.py +++ b/neurostore_sdk/models/image_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,88 +19,106 @@ import json from datetime import datetime -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ImageBase(BaseModel): """ ImageBase - """ - metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata about image such as software and version used and other relevant data about how the image was produced.") - url: Optional[StrictStr] = Field(None, description="URL to image file.") - filename: Optional[StrictStr] = Field(None, description="Name of the image file.") - space: Optional[StrictStr] = Field(None, description="The template space the image is in (e.g., MNI ") - value_type: Optional[StrictStr] = Field(None, description="The values the image represents. For example, T-statistic or Z-statistic, or Betas.") - add_date: Optional[datetime] = Field(None, description="Date the image was added.") - __properties = ["metadata", "url", "filename", "space", "value_type", "add_date"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata about image such as software and version used and other relevant data about how the image was produced.") + url: Optional[StrictStr] = Field(default=None, description="URL to image file.") + filename: Optional[StrictStr] = Field(default=None, description="Name of the image file.") + space: Optional[StrictStr] = Field(default=None, description="The template space the image is in (e.g., MNI ") + value_type: Optional[StrictStr] = Field(default=None, description="The values the image represents. For example, T-statistic or Z-statistic, or Betas.") + add_date: Optional[datetime] = Field(default=None, description="Date the image was added.") + __properties: ClassVar[List[str]] = ["metadata", "url", "filename", "space", "value_type", "add_date"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImageBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImageBase 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={ - "add_date", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "add_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if filename (nullable) is None - # and __fields_set__ contains the field - if self.filename is None and "filename" in self.__fields_set__: + # and model_fields_set contains the field + if self.filename is None and "filename" in self.model_fields_set: _dict['filename'] = None # set to None if space (nullable) is None - # and __fields_set__ contains the field - if self.space is None and "space" in self.__fields_set__: + # and model_fields_set contains the field + if self.space is None and "space" in self.model_fields_set: _dict['space'] = None # set to None if value_type (nullable) is None - # and __fields_set__ contains the field - if self.value_type is None and "value_type" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_type is None and "value_type" in self.model_fields_set: _dict['value_type'] = None # set to None if add_date (nullable) is None - # and __fields_set__ contains the field - if self.add_date is None and "add_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.add_date is None and "add_date" in self.model_fields_set: _dict['add_date'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ImageBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImageBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImageBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImageBase.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), "url": obj.get("url"), "filename": obj.get("filename"), @@ -110,3 +128,4 @@ def from_dict(cls, obj: dict) -> ImageBase: }) return _obj + diff --git a/neurostore_sdk/models/image_common.py b/neurostore_sdk/models/image_common.py index 9c91762..32eaf0a 100644 --- a/neurostore_sdk/models/image_common.py +++ b/neurostore_sdk/models/image_common.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,54 +18,71 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class ImageCommon(BaseModel): """ ImageCommon - """ + """ # noqa: E501 analysis: Optional[StrictStr] = None - __properties = ["analysis"] + __properties: ClassVar[List[str]] = ["analysis"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImageCommon: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImageCommon 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ImageCommon: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImageCommon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImageCommon.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImageCommon.parse_obj({ + _obj = cls.model_validate({ "analysis": obj.get("analysis") }) return _obj + diff --git a/neurostore_sdk/models/image_list.py b/neurostore_sdk/models/image_list.py index daacdd0..e59452c 100644 --- a/neurostore_sdk/models/image_list.py +++ b/neurostore_sdk/models/image_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.image_return import ImageReturn -from neurostore_sdk.models.metadata import Metadata +from typing import Optional, Set +from typing_extensions import Self class ImageList(BaseModel): """ ImageList - """ - results: Optional[conlist(ImageReturn)] = None + """ # noqa: E501 + results: Optional[List[ImageReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImageList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImageList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ImageList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImageList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImageList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImageList.parse_obj({ - "results": [ImageReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [ImageReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/image_relationships.py b/neurostore_sdk/models/image_relationships.py index 725aee0..e7d99b7 100644 --- a/neurostore_sdk/models/image_relationships.py +++ b/neurostore_sdk/models/image_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,71 +18,88 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.entity import Entity +from typing import Optional, Set +from typing_extensions import Self class ImageRelationships(BaseModel): """ ImageRelationships - """ + """ # noqa: E501 analysis: Optional[StrictStr] = None - entities: Optional[conlist(Entity)] = None + entities: Optional[List[Entity]] = None analysis_name: Optional[StrictStr] = None - __properties = ["analysis", "entities", "analysis_name"] + __properties: ClassVar[List[str]] = ["analysis", "entities", "analysis_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImageRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImageRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if analysis_name (nullable) is None - # and __fields_set__ contains the field - if self.analysis_name is None and "analysis_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.analysis_name is None and "analysis_name" in self.model_fields_set: _dict['analysis_name'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ImageRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImageRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImageRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImageRelationships.parse_obj({ + _obj = cls.model_validate({ "analysis": obj.get("analysis"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, "analysis_name": obj.get("analysis_name") }) return _obj + diff --git a/neurostore_sdk/models/image_request.py b/neurostore_sdk/models/image_request.py index 018842d..634999d 100644 --- a/neurostore_sdk/models/image_request.py +++ b/neurostore_sdk/models/image_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,106 +19,125 @@ import json from datetime import datetime -from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.entity import Entity +from typing import Optional, Set +from typing_extensions import Self class ImageRequest(BaseModel): """ ImageRequest - """ - metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata about image such as software and version used and other relevant data about how the image was produced.") - url: Optional[StrictStr] = Field(None, description="URL to image file.") - filename: Optional[StrictStr] = Field(None, description="Name of the image file.") - space: Optional[StrictStr] = Field(None, description="The template space the image is in (e.g., MNI ") - value_type: Optional[StrictStr] = Field(None, description="The values the image represents. For example, T-statistic or Z-statistic, or Betas.") - add_date: Optional[datetime] = Field(None, description="Date the image was added.") + """ # noqa: E501 + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata about image such as software and version used and other relevant data about how the image was produced.") + url: Optional[StrictStr] = Field(default=None, description="URL to image file.") + filename: Optional[StrictStr] = Field(default=None, description="Name of the image file.") + space: Optional[StrictStr] = Field(default=None, description="The template space the image is in (e.g., MNI ") + value_type: Optional[StrictStr] = Field(default=None, description="The values the image represents. For example, T-statistic or Z-statistic, or Betas.") + add_date: Optional[datetime] = Field(default=None, description="Date the image was added.") analysis: Optional[StrictStr] = None - entities: Optional[conlist(Entity)] = None + entities: Optional[List[Entity]] = None analysis_name: Optional[StrictStr] = None - id: Optional[constr(strict=True, max_length=30, 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 = ["metadata", "url", "filename", "space", "value_type", "add_date", "analysis", "entities", "analysis_name", "id", "public"] + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + __properties: ClassVar[List[str]] = ["metadata", "url", "filename", "space", "value_type", "add_date", "analysis", "entities", "analysis_name", "id", "public"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImageRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImageRequest 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={ - "add_date", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "add_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if filename (nullable) is None - # and __fields_set__ contains the field - if self.filename is None and "filename" in self.__fields_set__: + # and model_fields_set contains the field + if self.filename is None and "filename" in self.model_fields_set: _dict['filename'] = None # set to None if space (nullable) is None - # and __fields_set__ contains the field - if self.space is None and "space" in self.__fields_set__: + # and model_fields_set contains the field + if self.space is None and "space" in self.model_fields_set: _dict['space'] = None # set to None if value_type (nullable) is None - # and __fields_set__ contains the field - if self.value_type is None and "value_type" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_type is None and "value_type" in self.model_fields_set: _dict['value_type'] = None # set to None if add_date (nullable) is None - # and __fields_set__ contains the field - if self.add_date is None and "add_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.add_date is None and "add_date" in self.model_fields_set: _dict['add_date'] = None # set to None if analysis_name (nullable) is None - # and __fields_set__ contains the field - if self.analysis_name is None and "analysis_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.analysis_name is None and "analysis_name" in self.model_fields_set: _dict['analysis_name'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ImageRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImageRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImageRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImageRequest.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), "url": obj.get("url"), "filename": obj.get("filename"), @@ -126,10 +145,11 @@ def from_dict(cls, obj: dict) -> ImageRequest: "value_type": obj.get("value_type"), "add_date": obj.get("add_date"), "analysis": obj.get("analysis"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, "analysis_name": obj.get("analysis_name"), "id": obj.get("id"), "public": obj.get("public") if obj.get("public") is not None else True }) return _obj + diff --git a/neurostore_sdk/models/image_return.py b/neurostore_sdk/models/image_return.py index d23d3dc..502d789 100644 --- a/neurostore_sdk/models/image_return.py +++ b/neurostore_sdk/models/image_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,128 +19,150 @@ import json from datetime import datetime -from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.entity import Entity +from typing import Optional, Set +from typing_extensions import Self class ImageReturn(BaseModel): """ ImageReturn - """ - metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata about image such as software and version used and other relevant data about how the image was produced.") - url: Optional[StrictStr] = Field(None, description="URL to image file.") - filename: Optional[StrictStr] = Field(None, description="Name of the image file.") - space: Optional[StrictStr] = Field(None, description="The template space the image is in (e.g., MNI ") - value_type: Optional[StrictStr] = Field(None, description="The values the image represents. For example, T-statistic or Z-statistic, or Betas.") - add_date: Optional[datetime] = Field(None, description="Date the image was added.") + """ # noqa: E501 + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata about image such as software and version used and other relevant data about how the image was produced.") + url: Optional[StrictStr] = Field(default=None, description="URL to image file.") + filename: Optional[StrictStr] = Field(default=None, description="Name of the image file.") + space: Optional[StrictStr] = Field(default=None, description="The template space the image is in (e.g., MNI ") + value_type: Optional[StrictStr] = Field(default=None, description="The values the image represents. For example, T-statistic or Z-statistic, or Betas.") + add_date: Optional[datetime] = Field(default=None, description="Date the image was added.") analysis: Optional[StrictStr] = None - entities: Optional[conlist(Entity)] = None + entities: Optional[List[Entity]] = None analysis_name: Optional[StrictStr] = None - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") - __properties = ["metadata", "url", "filename", "space", "value_type", "add_date", "analysis", "entities", "analysis_name", "created_at", "updated_at", "id", "public", "user", "username"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") + __properties: ClassVar[List[str]] = ["metadata", "url", "filename", "space", "value_type", "add_date", "analysis", "entities", "analysis_name", "created_at", "updated_at", "id", "public", "user", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ImageReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ImageReturn 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={ - "add_date", - "created_at", - "updated_at", - "user", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "add_date", + "created_at", + "updated_at", + "user", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if url (nullable) is None - # and __fields_set__ contains the field - if self.url is None and "url" in self.__fields_set__: + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: _dict['url'] = None # set to None if filename (nullable) is None - # and __fields_set__ contains the field - if self.filename is None and "filename" in self.__fields_set__: + # and model_fields_set contains the field + if self.filename is None and "filename" in self.model_fields_set: _dict['filename'] = None # set to None if space (nullable) is None - # and __fields_set__ contains the field - if self.space is None and "space" in self.__fields_set__: + # and model_fields_set contains the field + if self.space is None and "space" in self.model_fields_set: _dict['space'] = None # set to None if value_type (nullable) is None - # and __fields_set__ contains the field - if self.value_type is None and "value_type" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_type is None and "value_type" in self.model_fields_set: _dict['value_type'] = None # set to None if add_date (nullable) is None - # and __fields_set__ contains the field - if self.add_date is None and "add_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.add_date is None and "add_date" in self.model_fields_set: _dict['add_date'] = None # set to None if analysis_name (nullable) is None - # and __fields_set__ contains the field - if self.analysis_name is None and "analysis_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.analysis_name is None and "analysis_name" in self.model_fields_set: _dict['analysis_name'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ImageReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ImageReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ImageReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = ImageReturn.parse_obj({ + _obj = cls.model_validate({ "metadata": obj.get("metadata"), "url": obj.get("url"), "filename": obj.get("filename"), @@ -148,7 +170,7 @@ def from_dict(cls, obj: dict) -> ImageReturn: "value_type": obj.get("value_type"), "add_date": obj.get("add_date"), "analysis": obj.get("analysis"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, "analysis_name": obj.get("analysis_name"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), @@ -159,3 +181,4 @@ def from_dict(cls, obj: dict) -> ImageReturn: }) return _obj + diff --git a/neurostore_sdk/models/json_ld.py b/neurostore_sdk/models/json_ld.py deleted file mode 100644 index 57331c6..0000000 --- a/neurostore_sdk/models/json_ld.py +++ /dev/null @@ -1,79 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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, Field, StrictStr -from neurostore_sdk.models.json_ld_context import JsonLdContext - -class JsonLd(BaseModel): - """ - JSON-LD elements for data tracking - """ - context: Optional[JsonLdContext] = Field(None, alias="@context") - id: Optional[StrictStr] = Field(None, alias="@id", description="URI of the resource") - type: Optional[StrictStr] = Field(None, alias="@type", description="One of the NiMADS data types") - __properties = ["@context", "@id", "@type"] - - 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) -> JsonLd: - """Create an instance of JsonLd 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) - # override the default output from pydantic by calling `to_dict()` of context - if self.context: - _dict['@context'] = self.context.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> JsonLd: - """Create an instance of JsonLd from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return JsonLd.parse_obj(obj) - - _obj = JsonLd.parse_obj({ - "context": JsonLdContext.from_dict(obj.get("@context")) if obj.get("@context") is not None else None, - "id": obj.get("@id"), - "type": obj.get("@type") - }) - return _obj - diff --git a/neurostore_sdk/models/json_ld_context.py b/neurostore_sdk/models/json_ld_context.py index 1703bd2..21983ff 100644 --- a/neurostore_sdk/models/json_ld_context.py +++ b/neurostore_sdk/models/json_ld_context.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,54 +18,71 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class JsonLdContext(BaseModel): """ Context for the shorthand names - """ - vocab: Optional[StrictStr] = Field(None, alias="@vocab", description="common URI prefix for @type") - __properties = ["@vocab"] + """ # noqa: E501 + vocab: Optional[StrictStr] = Field(default=None, description="common URI prefix for @type", alias="@vocab") + __properties: ClassVar[List[str]] = ["@vocab"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> JsonLdContext: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of JsonLdContext 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> JsonLdContext: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of JsonLdContext from a dict""" if obj is None: return None if not isinstance(obj, dict): - return JsonLdContext.parse_obj(obj) + return cls.model_validate(obj) - _obj = JsonLdContext.parse_obj({ - "vocab": obj.get("@vocab") + _obj = cls.model_validate({ + "@vocab": obj.get("@vocab") }) return _obj + diff --git a/neurostore_sdk/models/metadata.py b/neurostore_sdk/models/metadata.py deleted file mode 100644 index 73e893a..0000000 --- a/neurostore_sdk/models/metadata.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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, Field, StrictInt - -class Metadata(BaseModel): - """ - data included in every list response - """ - total_count: Optional[StrictInt] = Field(None, description="total number of entries ") - unique_count: Optional[StrictInt] = Field(None, description="count of elements for unique entries") - __properties = ["total_count", "unique_count"] - - 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) -> Metadata: - """Create an instance of Metadata 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={ - "total_count", - "unique_count", - }, - exclude_none=True) - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> Metadata: - """Create an instance of Metadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return Metadata.parse_obj(obj) - - _obj = Metadata.parse_obj({ - "total_count": obj.get("total_count"), - "unique_count": obj.get("unique_count") - }) - return _obj - diff --git a/neurostore_sdk/models/nested_put_attributes.py b/neurostore_sdk/models/nested_put_attributes.py index af9f5b1..9788cdf 100644 --- a/neurostore_sdk/models/nested_put_attributes.py +++ b/neurostore_sdk/models/nested_put_attributes.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,54 +18,71 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class NestedPutAttributes(BaseModel): """ NestedPutAttributes - """ + """ # noqa: E501 id: Optional[StrictStr] = None - __properties = ["id"] + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> NestedPutAttributes: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NestedPutAttributes 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> NestedPutAttributes: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NestedPutAttributes from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NestedPutAttributes.parse_obj(obj) + return cls.model_validate(obj) - _obj = NestedPutAttributes.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id") }) return _obj + diff --git a/neurostore_sdk/models/note_collection_base.py b/neurostore_sdk/models/note_collection_base.py index 149fe75..2dd8542 100644 --- a/neurostore_sdk/models/note_collection_base.py +++ b/neurostore_sdk/models/note_collection_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,59 +18,76 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class NoteCollectionBase(BaseModel): """ NoteCollectionBase - """ - note: Optional[Dict[str, Any]] = Field(None, description="The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys.") - __properties = ["note"] + """ # noqa: E501 + note: Optional[Dict[str, Any]] = Field(default=None, description="The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys.") + __properties: ClassVar[List[str]] = ["note"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> NoteCollectionBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NoteCollectionBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if note (nullable) is None - # and __fields_set__ contains the field - if self.note is None and "note" in self.__fields_set__: + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: _dict['note'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> NoteCollectionBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NoteCollectionBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NoteCollectionBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = NoteCollectionBase.parse_obj({ + _obj = cls.model_validate({ "note": obj.get("note") }) return _obj + diff --git a/neurostore_sdk/models/note_collection_list.py b/neurostore_sdk/models/note_collection_list.py index 688cd2b..1be36ac 100644 --- a/neurostore_sdk/models/note_collection_list.py +++ b/neurostore_sdk/models/note_collection_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist -from neurostore_sdk.models.metadata import Metadata +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.note_collection_return import NoteCollectionReturn +from typing import Optional, Set +from typing_extensions import Self class NoteCollectionList(BaseModel): """ NoteCollectionList - """ - results: Optional[conlist(NoteCollectionReturn)] = None + """ # noqa: E501 + results: Optional[List[NoteCollectionReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> NoteCollectionList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NoteCollectionList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> NoteCollectionList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NoteCollectionList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NoteCollectionList.parse_obj(obj) + return cls.model_validate(obj) - _obj = NoteCollectionList.parse_obj({ - "results": [NoteCollectionReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [NoteCollectionReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/note_collection_request.py b/neurostore_sdk/models/note_collection_request.py index a11af1d..0bf0bcc 100644 --- a/neurostore_sdk/models/note_collection_request.py +++ b/neurostore_sdk/models/note_collection_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,63 +18,81 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class NoteCollectionRequest(BaseModel): """ NoteCollectionRequest - """ - note: Optional[Dict[str, Any]] = Field(None, description="The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys.") - id: Optional[constr(strict=True, max_length=30, 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 = ["note", "id", "public"] + """ # noqa: E501 + note: Optional[Dict[str, Any]] = Field(default=None, description="The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + __properties: ClassVar[List[str]] = ["note", "id", "public"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> NoteCollectionRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NoteCollectionRequest 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if note (nullable) is None - # and __fields_set__ contains the field - if self.note is None and "note" in self.__fields_set__: + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: _dict['note'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> NoteCollectionRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NoteCollectionRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NoteCollectionRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = NoteCollectionRequest.parse_obj({ + _obj = cls.model_validate({ "note": obj.get("note"), "id": obj.get("id"), "public": obj.get("public") if obj.get("public") is not None else True }) return _obj + diff --git a/neurostore_sdk/models/note_collection_return.py b/neurostore_sdk/models/note_collection_return.py index f9b8c8f..2190767 100644 --- a/neurostore_sdk/models/note_collection_return.py +++ b/neurostore_sdk/models/note_collection_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,15 +18,16 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class NoteCollectionReturn(BaseModel): """ NoteCollectionReturn - """ - note: Optional[Dict[str, Any]] = Field(None, description="The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys.") + """ # noqa: E501 + note: Optional[Dict[str, Any]] = Field(default=None, description="The note will contain all note_keys as keys and have a value of either null or the value type specified in note_keys.") analysis: Optional[StrictStr] = None analysis_name: Optional[StrictStr] = None study: Optional[StrictStr] = None @@ -36,82 +37,105 @@ class NoteCollectionReturn(BaseModel): publication: Optional[StrictStr] = None authors: Optional[StrictStr] = None id: Optional[StrictStr] = None - __properties = ["note", "analysis", "analysis_name", "study", "study_name", "annotation", "study_year", "publication", "authors", "id"] + __properties: ClassVar[List[str]] = ["note", "analysis", "analysis_name", "study", "study_name", "annotation", "study_year", "publication", "authors", "id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> NoteCollectionReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NoteCollectionReturn 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={ - "analysis", - "analysis_name", - "study", - "study_name", - "annotation", - "study_year", - "publication", - "authors", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "analysis", + "analysis_name", + "study", + "study_name", + "annotation", + "study_year", + "publication", + "authors", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if note (nullable) is None - # and __fields_set__ contains the field - if self.note is None and "note" in self.__fields_set__: + # and model_fields_set contains the field + if self.note is None and "note" in self.model_fields_set: _dict['note'] = None # set to None if analysis_name (nullable) is None - # and __fields_set__ contains the field - if self.analysis_name is None and "analysis_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.analysis_name is None and "analysis_name" in self.model_fields_set: _dict['analysis_name'] = None # set to None if study_name (nullable) is None - # and __fields_set__ contains the field - if self.study_name is None and "study_name" in self.__fields_set__: + # and model_fields_set contains the field + if self.study_name is None and "study_name" in self.model_fields_set: _dict['study_name'] = None # set to None if study_year (nullable) is None - # and __fields_set__ contains the field - if self.study_year is None and "study_year" in self.__fields_set__: + # and model_fields_set contains the field + if self.study_year is None and "study_year" in self.model_fields_set: _dict['study_year'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: + # and model_fields_set contains the field + if self.authors is None and "authors" in self.model_fields_set: _dict['authors'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> NoteCollectionReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NoteCollectionReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NoteCollectionReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = NoteCollectionReturn.parse_obj({ + _obj = cls.model_validate({ "note": obj.get("note"), "analysis": obj.get("analysis"), "analysis_name": obj.get("analysis_name"), @@ -125,3 +149,4 @@ def from_dict(cls, obj: dict) -> NoteCollectionReturn: }) return _obj + diff --git a/neurostore_sdk/models/note_collection_return_all_of.py b/neurostore_sdk/models/note_collection_return_all_of.py deleted file mode 100644 index 46f6cec..0000000 --- a/neurostore_sdk/models/note_collection_return_all_of.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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, StrictInt, StrictStr - -class NoteCollectionReturnAllOf(BaseModel): - """ - NoteCollectionReturnAllOf - """ - analysis: Optional[StrictStr] = None - analysis_name: Optional[StrictStr] = None - study: Optional[StrictStr] = None - study_name: Optional[StrictStr] = None - annotation: Optional[StrictStr] = None - study_year: Optional[StrictInt] = None - publication: Optional[StrictStr] = None - authors: Optional[StrictStr] = None - id: Optional[StrictStr] = None - __properties = ["analysis", "analysis_name", "study", "study_name", "annotation", "study_year", "publication", "authors", "id"] - - 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) -> NoteCollectionReturnAllOf: - """Create an instance of NoteCollectionReturnAllOf 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={ - "analysis", - "analysis_name", - "study", - "study_name", - "annotation", - "study_year", - "publication", - "authors", - }, - exclude_none=True) - # set to None if analysis_name (nullable) is None - # and __fields_set__ contains the field - if self.analysis_name is None and "analysis_name" in self.__fields_set__: - _dict['analysis_name'] = None - - # set to None if study_name (nullable) is None - # and __fields_set__ contains the field - if self.study_name is None and "study_name" in self.__fields_set__: - _dict['study_name'] = None - - # set to None if study_year (nullable) is None - # and __fields_set__ contains the field - if self.study_year is None and "study_year" in self.__fields_set__: - _dict['study_year'] = None - - # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: - _dict['publication'] = None - - # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: - _dict['authors'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> NoteCollectionReturnAllOf: - """Create an instance of NoteCollectionReturnAllOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return NoteCollectionReturnAllOf.parse_obj(obj) - - _obj = NoteCollectionReturnAllOf.parse_obj({ - "analysis": obj.get("analysis"), - "analysis_name": obj.get("analysis_name"), - "study": obj.get("study"), - "study_name": obj.get("study_name"), - "annotation": obj.get("annotation"), - "study_year": obj.get("study_year"), - "publication": obj.get("publication"), - "authors": obj.get("authors"), - "id": obj.get("id") - }) - return _obj - diff --git a/neurostore_sdk/models/pipeline.py b/neurostore_sdk/models/pipeline.py new file mode 100644 index 0000000..0af68ae --- /dev/null +++ b/neurostore_sdk/models/pipeline.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Pipeline(BaseModel): + """ + Pipeline + """ # noqa: E501 + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + description: Optional[StrictStr] = None + version: Optional[StrictStr] = None + study_dependent: Optional[StrictBool] = None + ace_compatible: Optional[StrictBool] = None + pubget_compatible: Optional[StrictBool] = None + derived_from: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "name", "description", "version", "study_dependent", "ace_compatible", "pubget_compatible", "derived_from"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Pipeline from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Pipeline from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "version": obj.get("version"), + "study_dependent": obj.get("study_dependent"), + "ace_compatible": obj.get("ace_compatible"), + "pubget_compatible": obj.get("pubget_compatible"), + "derived_from": obj.get("derived_from") + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_config.py b/neurostore_sdk/models/pipeline_config.py new file mode 100644 index 0000000..8dbd691 --- /dev/null +++ b/neurostore_sdk/models/pipeline_config.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PipelineConfig(BaseModel): + """ + PipelineConfig + """ # noqa: E501 + id: Optional[StrictStr] = None + config: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["id", "config"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineConfig from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "config": obj.get("config") + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_config_list.py b/neurostore_sdk/models/pipeline_config_list.py new file mode 100644 index 0000000..2ced6cd --- /dev/null +++ b/neurostore_sdk/models/pipeline_config_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from neurostore_sdk.models.pipeline_config import PipelineConfig +from typing import Optional, Set +from typing_extensions import Self + +class PipelineConfigList(BaseModel): + """ + PipelineConfigList + """ # noqa: E501 + results: Optional[List[PipelineConfig]] = None + metadata: Optional[Metadata] = None + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineConfigList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineConfigList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PipelineConfig.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_list.py b/neurostore_sdk/models/pipeline_list.py new file mode 100644 index 0000000..452af5e --- /dev/null +++ b/neurostore_sdk/models/pipeline_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from neurostore_sdk.models.pipeline import Pipeline +from typing import Optional, Set +from typing_extensions import Self + +class PipelineList(BaseModel): + """ + PipelineList + """ # noqa: E501 + results: Optional[List[Pipeline]] = None + metadata: Optional[Metadata] = None + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [Pipeline.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_run.py b/neurostore_sdk/models/pipeline_run.py new file mode 100644 index 0000000..11de3e4 --- /dev/null +++ b/neurostore_sdk/models/pipeline_run.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PipelineRun(BaseModel): + """ + PipelineRun + """ # noqa: E501 + id: Optional[StrictStr] = None + status: Optional[StrictStr] = None + started_at: Optional[StrictStr] = None + finished_at: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["id", "status", "started_at", "finished_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineRun from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineRun from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status"), + "started_at": obj.get("started_at"), + "finished_at": obj.get("finished_at") + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_run_list.py b/neurostore_sdk/models/pipeline_run_list.py new file mode 100644 index 0000000..59f312f --- /dev/null +++ b/neurostore_sdk/models/pipeline_run_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from neurostore_sdk.models.pipeline_run import PipelineRun +from typing import Optional, Set +from typing_extensions import Self + +class PipelineRunList(BaseModel): + """ + PipelineRunList + """ # noqa: E501 + results: Optional[List[PipelineRun]] = None + metadata: Optional[Metadata] = None + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineRunList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineRunList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PipelineRun.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_run_result.py b/neurostore_sdk/models/pipeline_run_result.py new file mode 100644 index 0000000..c4d46bd --- /dev/null +++ b/neurostore_sdk/models/pipeline_run_result.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PipelineRunResult(BaseModel): + """ + PipelineRunResult + """ # noqa: E501 + id: Optional[StrictStr] = None + pipeline_run_id: Optional[StrictStr] = None + data: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["id", "pipeline_run_id", "data"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineRunResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineRunResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "pipeline_run_id": obj.get("pipeline_run_id"), + "data": obj.get("data") + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_run_result_list.py b/neurostore_sdk/models/pipeline_run_result_list.py new file mode 100644 index 0000000..0db5508 --- /dev/null +++ b/neurostore_sdk/models/pipeline_run_result_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult +from typing import Optional, Set +from typing_extensions import Self + +class PipelineRunResultList(BaseModel): + """ + PipelineRunResultList + """ # noqa: E501 + results: Optional[List[PipelineRunResult]] = None + metadata: Optional[Metadata] = None + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineRunResultList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineRunResultList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PipelineRunResult.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_run_result_vote.py b/neurostore_sdk/models/pipeline_run_result_vote.py new file mode 100644 index 0000000..6df4d0e --- /dev/null +++ b/neurostore_sdk/models/pipeline_run_result_vote.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PipelineRunResultVote(BaseModel): + """ + PipelineRunResultVote + """ # noqa: E501 + id: Optional[StrictStr] = None + pipeline_run_result_id: Optional[StrictStr] = None + user_id: Optional[StrictStr] = None + vote: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["id", "pipeline_run_result_id", "user_id", "vote"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineRunResultVote from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineRunResultVote from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "pipeline_run_result_id": obj.get("pipeline_run_result_id"), + "user_id": obj.get("user_id"), + "vote": obj.get("vote") + }) + return _obj + + diff --git a/neurostore_sdk/models/pipeline_run_result_vote_list.py b/neurostore_sdk/models/pipeline_run_result_vote_list.py new file mode 100644 index 0000000..1fb2edc --- /dev/null +++ b/neurostore_sdk/models/pipeline_run_result_vote_list.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote +from typing import Optional, Set +from typing_extensions import Self + +class PipelineRunResultVoteList(BaseModel): + """ + PipelineRunResultVoteList + """ # noqa: E501 + results: Optional[List[PipelineRunResultVote]] = None + metadata: Optional[Metadata] = None + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PipelineRunResultVoteList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in results (list) + _items = [] + if self.results: + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) + _dict['results'] = _items + # override the default output from pydantic by calling `to_dict()` of metadata + if self.metadata: + _dict['metadata'] = self.metadata.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PipelineRunResultVoteList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "results": [PipelineRunResultVote.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None + }) + return _obj + + diff --git a/neurostore_sdk/models/point_base.py b/neurostore_sdk/models/point_base.py index 304783a..6a9fe9c 100644 --- a/neurostore_sdk/models/point_base.py +++ b/neurostore_sdk/models/point_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,71 +18,88 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class PointBase(BaseModel): """ PointBase - """ - coordinates: Optional[conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=3)] = Field(None, description="Location of the significant coordinate in three dimensional space.") - space: Optional[StrictStr] = Field(None, description="Template space used to determine coordinate Examples include TAL or MNI.") - kind: Optional[StrictStr] = Field(None, description="Method of how point was derived (e.g., center of mass)") - label_id: Optional[StrictStr] = Field(None, description="If the point is associated with an image, this is the value the point takes in that image.") - __properties = ["coordinates", "space", "kind", "label_id"] + """ # noqa: E501 + coordinates: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=3, max_length=3)]] = Field(default=None, description="Location of the significant coordinate in three dimensional space.") + space: Optional[StrictStr] = Field(default=None, description="Template space used to determine coordinate Examples include TAL or MNI.") + kind: Optional[StrictStr] = Field(default=None, description="Method of how point was derived (e.g., center of mass)") + label_id: Optional[StrictStr] = Field(default=None, description="If the point is associated with an image, this is the value the point takes in that image.") + __properties: ClassVar[List[str]] = ["coordinates", "space", "kind", "label_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if space (nullable) is None - # and __fields_set__ contains the field - if self.space is None and "space" in self.__fields_set__: + # and model_fields_set contains the field + if self.space is None and "space" in self.model_fields_set: _dict['space'] = None # set to None if kind (nullable) is None - # and __fields_set__ contains the field - if self.kind is None and "kind" in self.__fields_set__: + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: _dict['kind'] = None # set to None if label_id (nullable) is None - # and __fields_set__ contains the field - if self.label_id is None and "label_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.label_id is None and "label_id" in self.model_fields_set: _dict['label_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointBase.parse_obj({ + _obj = cls.model_validate({ "coordinates": obj.get("coordinates"), "space": obj.get("space"), "kind": obj.get("kind"), @@ -90,3 +107,4 @@ def from_dict(cls, obj: dict) -> PointBase: }) return _obj + diff --git a/neurostore_sdk/models/point_common.py b/neurostore_sdk/models/point_common.py index 3d6a236..5a70c04 100644 --- a/neurostore_sdk/models/point_common.py +++ b/neurostore_sdk/models/point_common.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,71 +18,87 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self class PointCommon(BaseModel): """ PointCommon - """ + """ # noqa: E501 analysis: Optional[StrictStr] = None - cluster_size: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="size of the cluster in cubic millimeters") - subpeak: Optional[StrictBool] = Field(None, description="whether the reported peak is the max-peak statistic or a sub-maxmimal peak.") - order: Optional[StrictInt] = Field(None, description="determines the row to display the coordinate") - __properties = ["analysis", "cluster_size", "subpeak", "order"] + cluster_size: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="size of the cluster in cubic millimeters") + subpeak: Optional[StrictBool] = Field(default=None, description="whether the reported peak is the max-peak statistic or a sub-maxmimal peak.") + order: Optional[StrictInt] = Field(default=None, description="determines the row to display the coordinate") + __properties: ClassVar[List[str]] = ["analysis", "cluster_size", "subpeak", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointCommon: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointCommon 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if cluster_size (nullable) is None - # and __fields_set__ contains the field - if self.cluster_size is None and "cluster_size" in self.__fields_set__: + # and model_fields_set contains the field + if self.cluster_size is None and "cluster_size" in self.model_fields_set: _dict['cluster_size'] = None # set to None if subpeak (nullable) is None - # and __fields_set__ contains the field - if self.subpeak is None and "subpeak" in self.__fields_set__: + # and model_fields_set contains the field + if self.subpeak is None and "subpeak" in self.model_fields_set: _dict['subpeak'] = None # set to None if order (nullable) is None - # and __fields_set__ contains the field - if self.order is None and "order" in self.__fields_set__: + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: _dict['order'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointCommon: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointCommon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointCommon.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointCommon.parse_obj({ + _obj = cls.model_validate({ "analysis": obj.get("analysis"), "cluster_size": obj.get("cluster_size"), "subpeak": obj.get("subpeak"), @@ -90,3 +106,4 @@ def from_dict(cls, obj: dict) -> PointCommon: }) return _obj + diff --git a/neurostore_sdk/models/point_list.py b/neurostore_sdk/models/point_list.py index 64df0b2..0e700dc 100644 --- a/neurostore_sdk/models/point_list.py +++ b/neurostore_sdk/models/point_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist -from neurostore_sdk.models.metadata import Metadata +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.point_return import PointReturn +from typing import Optional, Set +from typing_extensions import Self class PointList(BaseModel): """ PointList - """ - results: Optional[conlist(PointReturn)] = None + """ # noqa: E501 + results: Optional[List[PointReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> PointList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointList.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointList.parse_obj({ - "results": [PointReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [PointReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/point_relationships.py b/neurostore_sdk/models/point_relationships.py index e3fc4fd..a0ebc05 100644 --- a/neurostore_sdk/models/point_relationships.py +++ b/neurostore_sdk/models/point_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,81 +18,98 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union from neurostore_sdk.models.entity import Entity from neurostore_sdk.models.point_relationships_values import PointRelationshipsValues +from typing import Optional, Set +from typing_extensions import Self class PointRelationships(BaseModel): """ PointRelationships - """ + """ # noqa: E501 image: Optional[StrictStr] = None values: Optional[PointRelationshipsValues] = None x: Optional[Union[StrictFloat, StrictInt]] = None y: Optional[Union[StrictFloat, StrictInt]] = None z: Optional[Union[StrictFloat, StrictInt]] = None - entities: Optional[conlist(Entity)] = None - __properties = ["image", "values", "x", "y", "z", "entities"] + entities: Optional[List[Entity]] = None + __properties: ClassVar[List[str]] = ["image", "values", "x", "y", "z", "entities"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of values if self.values: _dict['values'] = self.values.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if image (nullable) is None - # and __fields_set__ contains the field - if self.image is None and "image" in self.__fields_set__: + # and model_fields_set contains the field + if self.image is None and "image" in self.model_fields_set: _dict['image'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointRelationships.parse_obj({ + _obj = cls.model_validate({ "image": obj.get("image"), - "values": PointRelationshipsValues.from_dict(obj.get("values")) if obj.get("values") is not None else None, + "values": PointRelationshipsValues.from_dict(obj["values"]) if obj.get("values") is not None else None, "x": obj.get("x"), "y": obj.get("y"), "z": obj.get("z"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/point_relationships_value.py b/neurostore_sdk/models/point_relationships_value.py deleted file mode 100644 index 48ee7be..0000000 --- a/neurostore_sdk/models/point_relationships_value.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.point_value import PointValue -from typing import Any, List -from pydantic import StrictStr, Field - -POINTRELATIONSHIPSVALUE_ONE_OF_SCHEMAS = ["PointValue", "str"] - -class PointRelationshipsValue(BaseModel): - """ - PointRelationshipsValue - """ - # data type: PointValue - oneof_schema_1_validator: Optional[PointValue] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(POINTRELATIONSHIPSVALUE_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = PointRelationshipsValue.construct() - error_messages = [] - match = 0 - # validate data type: PointValue - if not isinstance(v, PointValue): - error_messages.append(f"Error! Input type `{type(v)}` is not `PointValue`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in PointRelationshipsValue with oneOf schemas: PointValue, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in PointRelationshipsValue with oneOf schemas: PointValue, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> PointRelationshipsValue: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> PointRelationshipsValue: - """Returns the object represented by the json string""" - instance = PointRelationshipsValue.construct() - error_messages = [] - match = 0 - - # deserialize data into PointValue - try: - instance.actual_instance = PointValue.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into PointRelationshipsValue with oneOf schemas: PointValue, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into PointRelationshipsValue with oneOf schemas: PointValue, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/point_relationships_values.py b/neurostore_sdk/models/point_relationships_values.py index 871af49..4055e55 100644 --- a/neurostore_sdk/models/point_relationships_values.py +++ b/neurostore_sdk/models/point_relationships_values.py @@ -3,45 +3,47 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.point_value import PointValue -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self -POINTRELATIONSHIPSVALUES_ONE_OF_SCHEMAS = ["List[PointValue]", "List[str]"] +POINTRELATIONSHIPSVALUES_ONE_OF_SCHEMAS = ["List[Optional[str]]", "List[PointValue]"] class PointRelationshipsValues(BaseModel): """ PointRelationshipsValues """ # data type: List[PointValue] - oneof_schema_1_validator: Optional[conlist(PointValue, min_items=1)] = None - # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(POINTRELATIONSHIPSVALUES_ONE_OF_SCHEMAS, const=True) + oneof_schema_1_validator: Optional[Annotated[List[PointValue], Field(min_length=1)]] = None + # data type: List[Optional[str]] + oneof_schema_2_validator: Optional[List[Optional[StrictStr]]] = None + actual_instance: Optional[Union[List[Optional[str]], List[PointValue]]] = None + one_of_schemas: Set[str] = { "List[Optional[str]]", "List[PointValue]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = PointRelationshipsValues.construct() + instance = PointRelationshipsValues.model_construct() error_messages = [] match = 0 # validate data type: List[PointValue] @@ -62,7 +64,7 @@ def actual_instance_must_validate_oneof(cls, v): match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # validate data type: List[str] + # validate data type: List[Optional[str]] try: instance.oneof_schema_2_validator = v match += 1 @@ -70,21 +72,21 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in PointRelationshipsValues with oneOf schemas: List[PointValue], List[str]. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in PointRelationshipsValues with oneOf schemas: List[Optional[str]], List[PointValue]. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in PointRelationshipsValues with oneOf schemas: List[PointValue], List[str]. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in PointRelationshipsValues with oneOf schemas: List[Optional[str]], List[PointValue]. Details: " + ", ".join(error_messages)) else: return v @classmethod - def from_dict(cls, obj: dict) -> PointRelationshipsValues: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> PointRelationshipsValues: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = PointRelationshipsValues.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -97,7 +99,7 @@ def from_json(cls, json_str: str) -> PointRelationshipsValues: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into List[str] + # deserialize data into List[Optional[str]] try: # validation instance.oneof_schema_2_validator = json.loads(json_str) @@ -109,10 +111,10 @@ def from_json(cls, json_str: str) -> PointRelationshipsValues: if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into PointRelationshipsValues with oneOf schemas: List[PointValue], List[str]. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into PointRelationshipsValues with oneOf schemas: List[Optional[str]], List[PointValue]. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into PointRelationshipsValues with oneOf schemas: List[PointValue], List[str]. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into PointRelationshipsValues with oneOf schemas: List[Optional[str]], List[PointValue]. Details: " + ", ".join(error_messages)) else: return instance @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[Optional[str]], List[PointValue]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/point_request.py b/neurostore_sdk/models/point_request.py index 7cdae18..509c521 100644 --- a/neurostore_sdk/models/point_request.py +++ b/neurostore_sdk/models/point_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,125 +18,142 @@ import re # noqa: F401 import json - -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from neurostore_sdk.models.entity import Entity from neurostore_sdk.models.point_relationships_values import PointRelationshipsValues +from typing import Optional, Set +from typing_extensions import Self class PointRequest(BaseModel): """ PointRequest - """ - coordinates: Optional[conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=3)] = Field(None, description="Location of the significant coordinate in three dimensional space.") - space: Optional[StrictStr] = Field(None, description="Template space used to determine coordinate Examples include TAL or MNI.") - kind: Optional[StrictStr] = Field(None, description="Method of how point was derived (e.g., center of mass)") - label_id: Optional[StrictStr] = Field(None, description="If the point is associated with an image, this is the value the point takes in that image.") + """ # noqa: E501 + coordinates: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=3, max_length=3)]] = Field(default=None, description="Location of the significant coordinate in three dimensional space.") + space: Optional[StrictStr] = Field(default=None, description="Template space used to determine coordinate Examples include TAL or MNI.") + kind: Optional[StrictStr] = Field(default=None, description="Method of how point was derived (e.g., center of mass)") + label_id: Optional[StrictStr] = Field(default=None, description="If the point is associated with an image, this is the value the point takes in that image.") image: Optional[StrictStr] = None values: Optional[PointRelationshipsValues] = None x: Optional[Union[StrictFloat, StrictInt]] = None y: Optional[Union[StrictFloat, StrictInt]] = None z: Optional[Union[StrictFloat, StrictInt]] = None - entities: Optional[conlist(Entity)] = None - id: Optional[constr(strict=True, max_length=30, 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") + entities: Optional[List[Entity]] = None + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") analysis: Optional[StrictStr] = None - cluster_size: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="size of the cluster in cubic millimeters") - subpeak: Optional[StrictBool] = Field(None, description="whether the reported peak is the max-peak statistic or a sub-maxmimal peak.") - order: Optional[StrictInt] = Field(None, description="determines the row to display the coordinate") - __properties = ["coordinates", "space", "kind", "label_id", "image", "values", "x", "y", "z", "entities", "id", "public", "analysis", "cluster_size", "subpeak", "order"] + cluster_size: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="size of the cluster in cubic millimeters") + subpeak: Optional[StrictBool] = Field(default=None, description="whether the reported peak is the max-peak statistic or a sub-maxmimal peak.") + order: Optional[StrictInt] = Field(default=None, description="determines the row to display the coordinate") + __properties: ClassVar[List[str]] = ["coordinates", "space", "kind", "label_id", "image", "values", "x", "y", "z", "entities", "id", "public", "analysis", "cluster_size", "subpeak", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointRequest 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of values if self.values: _dict['values'] = self.values.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if space (nullable) is None - # and __fields_set__ contains the field - if self.space is None and "space" in self.__fields_set__: + # and model_fields_set contains the field + if self.space is None and "space" in self.model_fields_set: _dict['space'] = None # set to None if kind (nullable) is None - # and __fields_set__ contains the field - if self.kind is None and "kind" in self.__fields_set__: + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: _dict['kind'] = None # set to None if label_id (nullable) is None - # and __fields_set__ contains the field - if self.label_id is None and "label_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.label_id is None and "label_id" in self.model_fields_set: _dict['label_id'] = None # set to None if image (nullable) is None - # and __fields_set__ contains the field - if self.image is None and "image" in self.__fields_set__: + # and model_fields_set contains the field + if self.image is None and "image" in self.model_fields_set: _dict['image'] = None # set to None if cluster_size (nullable) is None - # and __fields_set__ contains the field - if self.cluster_size is None and "cluster_size" in self.__fields_set__: + # and model_fields_set contains the field + if self.cluster_size is None and "cluster_size" in self.model_fields_set: _dict['cluster_size'] = None # set to None if subpeak (nullable) is None - # and __fields_set__ contains the field - if self.subpeak is None and "subpeak" in self.__fields_set__: + # and model_fields_set contains the field + if self.subpeak is None and "subpeak" in self.model_fields_set: _dict['subpeak'] = None # set to None if order (nullable) is None - # and __fields_set__ contains the field - if self.order is None and "order" in self.__fields_set__: + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: _dict['order'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointRequest.parse_obj({ + _obj = cls.model_validate({ "coordinates": obj.get("coordinates"), "space": obj.get("space"), "kind": obj.get("kind"), "label_id": obj.get("label_id"), "image": obj.get("image"), - "values": PointRelationshipsValues.from_dict(obj.get("values")) if obj.get("values") is not None else None, + "values": PointRelationshipsValues.from_dict(obj["values"]) if obj.get("values") is not None else None, "x": obj.get("x"), "y": obj.get("y"), "z": obj.get("z"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, "id": obj.get("id"), "public": obj.get("public") if obj.get("public") is not None else True, "analysis": obj.get("analysis"), @@ -146,3 +163,4 @@ def from_dict(cls, obj: dict) -> PointRequest: }) return _obj + diff --git a/neurostore_sdk/models/point_return.py b/neurostore_sdk/models/point_return.py index af3cac2..3a79689 100644 --- a/neurostore_sdk/models/point_return.py +++ b/neurostore_sdk/models/point_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,136 +19,157 @@ import json from datetime import datetime -from typing import List, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from neurostore_sdk.models.entity import Entity from neurostore_sdk.models.point_relationships_values import PointRelationshipsValues +from typing import Optional, Set +from typing_extensions import Self class PointReturn(BaseModel): """ PointReturn - """ - coordinates: Optional[conlist(Union[StrictFloat, StrictInt], max_items=3, min_items=3)] = Field(None, description="Location of the significant coordinate in three dimensional space.") - space: Optional[StrictStr] = Field(None, description="Template space used to determine coordinate Examples include TAL or MNI.") - kind: Optional[StrictStr] = Field(None, description="Method of how point was derived (e.g., center of mass)") - label_id: Optional[StrictStr] = Field(None, description="If the point is associated with an image, this is the value the point takes in that image.") - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") + """ # noqa: E501 + coordinates: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=3, max_length=3)]] = Field(default=None, description="Location of the significant coordinate in three dimensional space.") + space: Optional[StrictStr] = Field(default=None, description="Template space used to determine coordinate Examples include TAL or MNI.") + kind: Optional[StrictStr] = Field(default=None, description="Method of how point was derived (e.g., center of mass)") + label_id: Optional[StrictStr] = Field(default=None, description="If the point is associated with an image, this is the value the point takes in that image.") + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") image: Optional[StrictStr] = None values: Optional[PointRelationshipsValues] = None x: Optional[Union[StrictFloat, StrictInt]] = None y: Optional[Union[StrictFloat, StrictInt]] = None z: Optional[Union[StrictFloat, StrictInt]] = None - entities: Optional[conlist(Entity)] = None + entities: Optional[List[Entity]] = None analysis: Optional[StrictStr] = None - cluster_size: Optional[Union[StrictFloat, StrictInt]] = Field(None, description="size of the cluster in cubic millimeters") - subpeak: Optional[StrictBool] = Field(None, description="whether the reported peak is the max-peak statistic or a sub-maxmimal peak.") - order: Optional[StrictInt] = Field(None, description="determines the row to display the coordinate") - __properties = ["coordinates", "space", "kind", "label_id", "created_at", "updated_at", "id", "public", "user", "username", "image", "values", "x", "y", "z", "entities", "analysis", "cluster_size", "subpeak", "order"] + cluster_size: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="size of the cluster in cubic millimeters") + subpeak: Optional[StrictBool] = Field(default=None, description="whether the reported peak is the max-peak statistic or a sub-maxmimal peak.") + order: Optional[StrictInt] = Field(default=None, description="determines the row to display the coordinate") + __properties: ClassVar[List[str]] = ["coordinates", "space", "kind", "label_id", "created_at", "updated_at", "id", "public", "user", "username", "image", "values", "x", "y", "z", "entities", "analysis", "cluster_size", "subpeak", "order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointReturn 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={ - "created_at", - "updated_at", - "user", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of values if self.values: _dict['values'] = self.values.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in entities (list) _items = [] if self.entities: - for _item in self.entities: - if _item: - _items.append(_item.to_dict()) + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) _dict['entities'] = _items # set to None if space (nullable) is None - # and __fields_set__ contains the field - if self.space is None and "space" in self.__fields_set__: + # and model_fields_set contains the field + if self.space is None and "space" in self.model_fields_set: _dict['space'] = None # set to None if kind (nullable) is None - # and __fields_set__ contains the field - if self.kind is None and "kind" in self.__fields_set__: + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: _dict['kind'] = None # set to None if label_id (nullable) is None - # and __fields_set__ contains the field - if self.label_id is None and "label_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.label_id is None and "label_id" in self.model_fields_set: _dict['label_id'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None # set to None if image (nullable) is None - # and __fields_set__ contains the field - if self.image is None and "image" in self.__fields_set__: + # and model_fields_set contains the field + if self.image is None and "image" in self.model_fields_set: _dict['image'] = None # set to None if cluster_size (nullable) is None - # and __fields_set__ contains the field - if self.cluster_size is None and "cluster_size" in self.__fields_set__: + # and model_fields_set contains the field + if self.cluster_size is None and "cluster_size" in self.model_fields_set: _dict['cluster_size'] = None # set to None if subpeak (nullable) is None - # and __fields_set__ contains the field - if self.subpeak is None and "subpeak" in self.__fields_set__: + # and model_fields_set contains the field + if self.subpeak is None and "subpeak" in self.model_fields_set: _dict['subpeak'] = None # set to None if order (nullable) is None - # and __fields_set__ contains the field - if self.order is None and "order" in self.__fields_set__: + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: _dict['order'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointReturn.parse_obj({ + _obj = cls.model_validate({ "coordinates": obj.get("coordinates"), "space": obj.get("space"), "kind": obj.get("kind"), @@ -160,11 +181,11 @@ def from_dict(cls, obj: dict) -> PointReturn: "user": obj.get("user"), "username": obj.get("username"), "image": obj.get("image"), - "values": PointRelationshipsValues.from_dict(obj.get("values")) if obj.get("values") is not None else None, + "values": PointRelationshipsValues.from_dict(obj["values"]) if obj.get("values") is not None else None, "x": obj.get("x"), "y": obj.get("y"), "z": obj.get("z"), - "entities": [Entity.from_dict(_item) for _item in obj.get("entities")] if obj.get("entities") is not None else None, + "entities": [Entity.from_dict(_item) for _item in obj["entities"]] if obj.get("entities") is not None else None, "analysis": obj.get("analysis"), "cluster_size": obj.get("cluster_size"), "subpeak": obj.get("subpeak"), @@ -172,3 +193,4 @@ def from_dict(cls, obj: dict) -> PointReturn: }) return _obj + diff --git a/neurostore_sdk/models/point_value.py b/neurostore_sdk/models/point_value.py index c2b8df0..7dbd1a4 100644 --- a/neurostore_sdk/models/point_value.py +++ b/neurostore_sdk/models/point_value.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,66 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self class PointValue(BaseModel): """ - """ + """ # noqa: E501 kind: Optional[StrictStr] = None value: Optional[Union[StrictFloat, StrictInt]] = None - __properties = ["kind", "value"] + __properties: ClassVar[List[str]] = ["kind", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PointValue: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PointValue 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if kind (nullable) is None - # and __fields_set__ contains the field - if self.kind is None and "kind" in self.__fields_set__: + # and model_fields_set contains the field + if self.kind is None and "kind" in self.model_fields_set: _dict['kind'] = None # set to None if value (nullable) is None - # and __fields_set__ contains the field - if self.value is None and "value" in self.__fields_set__: + # and model_fields_set contains the field + if self.value is None and "value" in self.model_fields_set: _dict['value'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PointValue: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PointValue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PointValue.parse_obj(obj) + return cls.model_validate(obj) - _obj = PointValue.parse_obj({ + _obj = cls.model_validate({ "kind": obj.get("kind"), "value": obj.get("value") }) return _obj + diff --git a/neurostore_sdk/models/readable_resource_attributes.py b/neurostore_sdk/models/readable_resource_attributes.py deleted file mode 100644 index e67d0cf..0000000 --- a/neurostore_sdk/models/readable_resource_attributes.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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 datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictStr - -class ReadableResourceAttributes(BaseModel): - """ - common readable resource attributes - """ - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - __properties = ["created_at", "updated_at"] - - 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) -> ReadableResourceAttributes: - """Create an instance of ReadableResourceAttributes 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={ - "created_at", - "updated_at", - }, - exclude_none=True) - # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: - _dict['updated_at'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> ReadableResourceAttributes: - """Create an instance of ReadableResourceAttributes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return ReadableResourceAttributes.parse_obj(obj) - - _obj = ReadableResourceAttributes.parse_obj({ - "created_at": obj.get("created_at"), - "updated_at": obj.get("updated_at") - }) - return _obj - diff --git a/neurostore_sdk/models/resource_attributes.py b/neurostore_sdk/models/resource_attributes.py index b0cca9d..5015f2c 100644 --- a/neurostore_sdk/models/resource_attributes.py +++ b/neurostore_sdk/models/resource_attributes.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,75 +19,96 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class ResourceAttributes(BaseModel): """ common attributes for user owned resources - """ - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") - __properties = ["created_at", "updated_at", "id", "public", "user", "username"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") + __properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "public", "user", "username"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ResourceAttributes: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResourceAttributes 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={ - "created_at", - "updated_at", - "user", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ResourceAttributes: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResourceAttributes from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResourceAttributes.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResourceAttributes.parse_obj({ + _obj = cls.model_validate({ "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), "id": obj.get("id"), @@ -97,3 +118,4 @@ def from_dict(cls, obj: dict) -> ResourceAttributes: }) return _obj + diff --git a/neurostore_sdk/models/study_base.py b/neurostore_sdk/models/study_base.py index 15d1ec3..677f734 100644 --- a/neurostore_sdk/models/study_base.py +++ b/neurostore_sdk/models/study_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,100 +18,117 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class StudyBase(BaseModel): """ StudyBase - """ - doi: Optional[StrictStr] = Field(None, description="Digital object identifier of the study.") - name: Optional[StrictStr] = Field(None, description="Title of the study.") - metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata associated with the study not covered by the other study attributes.") - description: Optional[StrictStr] = Field(None, description="Long form description of the study, typically the abstract.") - publication: Optional[StrictStr] = Field(None, description="The journal/place of publication for the study.") - pmid: Optional[StrictStr] = Field(None, description="If the study was published on PubMed, place the PubMed ID here.") - authors: Optional[StrictStr] = Field(None, description="The authors on the publication of this study.") - year: Optional[conint(strict=True, le=9999, ge=0)] = Field(None, description="The year this study was published.") - __properties = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + doi: Optional[StrictStr] = Field(default=None, description="Digital object identifier of the study.") + name: Optional[StrictStr] = Field(default=None, description="Title of the study.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata associated with the study not covered by the other study attributes.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the study, typically the abstract.") + publication: Optional[StrictStr] = Field(default=None, description="The journal/place of publication for the study.") + pmid: Optional[StrictStr] = Field(default=None, description="If the study was published on PubMed, place the PubMed ID here.") + authors: Optional[StrictStr] = Field(default=None, description="The authors on the publication of this study.") + year: Optional[Annotated[int, Field(le=9999, strict=True, ge=0)]] = Field(default=None, description="The year this study was published.") + __properties: ClassVar[List[str]] = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: + # and model_fields_set contains the field + if self.authors is None and "authors" in self.model_fields_set: _dict['authors'] = None # set to None if year (nullable) is None - # and __fields_set__ contains the field - if self.year is None and "year" in self.__fields_set__: + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: _dict['year'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyBase.parse_obj({ + _obj = cls.model_validate({ "doi": obj.get("doi"), "name": obj.get("name"), "metadata": obj.get("metadata"), @@ -123,3 +140,4 @@ def from_dict(cls, obj: dict) -> StudyBase: }) return _obj + diff --git a/neurostore_sdk/models/study_common.py b/neurostore_sdk/models/study_common.py index f15cc10..dafc97e 100644 --- a/neurostore_sdk/models/study_common.py +++ b/neurostore_sdk/models/study_common.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,64 +18,81 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StudyCommon(BaseModel): """ StudyCommon - """ + """ # noqa: E501 level: Optional[StrictStr] = None - __properties = ["level"] + __properties: ClassVar[List[str]] = ["level"] - @validator('level') + @field_validator('level') def level_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in ('group', 'meta'): + if value not in set(['group', 'meta']): raise ValueError("must be one of enum values ('group', 'meta')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyCommon: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyCommon 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyCommon: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyCommon from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyCommon.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyCommon.parse_obj({ + _obj = cls.model_validate({ "level": obj.get("level") }) return _obj + diff --git a/neurostore_sdk/models/study_list.py b/neurostore_sdk/models/study_list.py index d1b7653..d59982f 100644 --- a/neurostore_sdk/models/study_list.py +++ b/neurostore_sdk/models/study_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist -from neurostore_sdk.models.metadata import Metadata +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.study_return import StudyReturn +from typing import Optional, Set +from typing_extensions import Self class StudyList(BaseModel): """ StudyList - """ - results: Optional[conlist(StudyReturn)] = None + """ # noqa: E501 + results: Optional[List[StudyReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyList.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyList.parse_obj({ - "results": [StudyReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [StudyReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/study_request.py b/neurostore_sdk/models/study_request.py index 5aabe8a..6d5d77f 100644 --- a/neurostore_sdk/models/study_request.py +++ b/neurostore_sdk/models/study_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,113 +18,130 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses +from typing import Optional, Set +from typing_extensions import Self 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.") - metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata associated with the study not covered by the other study attributes.") - description: Optional[StrictStr] = Field(None, description="Long form description of the study, typically the abstract.") - publication: Optional[StrictStr] = Field(None, description="The journal/place of publication for the study.") - pmid: Optional[StrictStr] = Field(None, description="If the study was published on PubMed, place the PubMed ID here.") - authors: Optional[StrictStr] = Field(None, description="The authors on the publication of this study.") - year: Optional[conint(strict=True, le=9999, ge=0)] = Field(None, description="The year this study was published.") + """ # noqa: E501 + doi: Optional[StrictStr] = Field(default=None, description="Digital object identifier of the study.") + name: Optional[StrictStr] = Field(default=None, description="Title of the study.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata associated with the study not covered by the other study attributes.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the study, typically the abstract.") + publication: Optional[StrictStr] = Field(default=None, description="The journal/place of publication for the study.") + pmid: Optional[StrictStr] = Field(default=None, description="If the study was published on PubMed, place the PubMed ID here.") + authors: Optional[StrictStr] = Field(default=None, description="The authors on the publication of this study.") + year: Optional[Annotated[int, Field(le=9999, strict=True, ge=0)]] = Field(default=None, description="The year this study was published.") analyses: Optional[StudyRequestRelationshipsAnalyses] = None - id: Optional[constr(strict=True, max_length=30, 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") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") pmcid: Optional[StrictStr] = None - __properties = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year", "analyses", "id", "public", "pmcid"] + __properties: ClassVar[List[str]] = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year", "analyses", "id", "public", "pmcid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyRequest 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of analyses if self.analyses: _dict['analyses'] = self.analyses.to_dict() # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: + # and model_fields_set contains the field + if self.authors is None and "authors" in self.model_fields_set: _dict['authors'] = None # set to None if year (nullable) is None - # and __fields_set__ contains the field - if self.year is None and "year" in self.__fields_set__: + # and model_fields_set contains the field + if self.year is None and "year" in self.model_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__: + # and model_fields_set contains the field + if self.pmcid is None and "pmcid" in self.model_fields_set: _dict['pmcid'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyRequest.parse_obj({ + _obj = cls.model_validate({ "doi": obj.get("doi"), "name": obj.get("name"), "metadata": obj.get("metadata"), @@ -133,10 +150,11 @@ def from_dict(cls, obj: dict) -> StudyRequest: "pmid": obj.get("pmid"), "authors": obj.get("authors"), "year": obj.get("year"), - "analyses": StudyRequestRelationshipsAnalyses.from_dict(obj.get("analyses")) if obj.get("analyses") is not None else None, + "analyses": StudyRequestRelationshipsAnalyses.from_dict(obj["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, "pmcid": obj.get("pmcid") }) return _obj + diff --git a/neurostore_sdk/models/study_request_all_of.py b/neurostore_sdk/models/study_request_all_of.py deleted file mode 100644 index b6b0e52..0000000 --- a/neurostore_sdk/models/study_request_all_of.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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 - diff --git a/neurostore_sdk/models/study_request_relationships.py b/neurostore_sdk/models/study_request_relationships.py index d40888e..8853d84 100644 --- a/neurostore_sdk/models/study_request_relationships.py +++ b/neurostore_sdk/models/study_request_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses +from typing import Optional, Set +from typing_extensions import Self class StudyRequestRelationships(BaseModel): """ StudyRequestRelationships - """ + """ # noqa: E501 analyses: Optional[StudyRequestRelationshipsAnalyses] = None - __properties = ["analyses"] + __properties: ClassVar[List[str]] = ["analyses"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyRequestRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyRequestRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of analyses if self.analyses: _dict['analyses'] = self.analyses.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyRequestRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyRequestRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyRequestRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyRequestRelationships.parse_obj({ - "analyses": StudyRequestRelationshipsAnalyses.from_dict(obj.get("analyses")) if obj.get("analyses") is not None else None + _obj = cls.model_validate({ + "analyses": StudyRequestRelationshipsAnalyses.from_dict(obj["analyses"]) if obj.get("analyses") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/study_request_relationships_analyses.py b/neurostore_sdk/models/study_request_relationships_analyses.py index 98d676d..11f15a6 100644 --- a/neurostore_sdk/models/study_request_relationships_analyses.py +++ b/neurostore_sdk/models/study_request_relationships_analyses.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.analysis_request import AnalysisRequest -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self STUDYREQUESTRELATIONSHIPSANALYSES_ONE_OF_SCHEMAS = ["List[AnalysisRequest]", "List[str]"] @@ -32,16 +31,19 @@ class StudyRequestRelationshipsAnalyses(BaseModel): StudyRequestRelationshipsAnalyses """ # data type: List[AnalysisRequest] - oneof_schema_1_validator: Optional[conlist(AnalysisRequest, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[AnalysisRequest], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYREQUESTRELATIONSHIPSANALYSES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[AnalysisRequest], List[str]]] = None + one_of_schemas: Set[str] = { "List[AnalysisRequest]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = StudyRequestRelationshipsAnalyses.construct() + instance = StudyRequestRelationshipsAnalyses.model_construct() error_messages = [] match = 0 # validate data type: List[AnalysisRequest] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> StudyRequestRelationshipsAnalyses: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> StudyRequestRelationshipsAnalyses: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = StudyRequestRelationshipsAnalyses.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[AnalysisRequest], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/study_request_relationships_analyses_inner.py b/neurostore_sdk/models/study_request_relationships_analyses_inner.py deleted file mode 100644 index 8dc2458..0000000 --- a/neurostore_sdk/models/study_request_relationships_analyses_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.analysis_request import AnalysisRequest -from typing import Any, List -from pydantic import StrictStr, Field - -STUDYREQUESTRELATIONSHIPSANALYSESINNER_ONE_OF_SCHEMAS = ["AnalysisRequest", "str"] - -class StudyRequestRelationshipsAnalysesInner(BaseModel): - """ - StudyRequestRelationshipsAnalysesInner - """ - # data type: AnalysisRequest - oneof_schema_1_validator: Optional[AnalysisRequest] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYREQUESTRELATIONSHIPSANALYSESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = StudyRequestRelationshipsAnalysesInner.construct() - error_messages = [] - match = 0 - # validate data type: AnalysisRequest - if not isinstance(v, AnalysisRequest): - error_messages.append(f"Error! Input type `{type(v)}` is not `AnalysisRequest`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in StudyRequestRelationshipsAnalysesInner with oneOf schemas: AnalysisRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in StudyRequestRelationshipsAnalysesInner with oneOf schemas: AnalysisRequest, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> StudyRequestRelationshipsAnalysesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> StudyRequestRelationshipsAnalysesInner: - """Returns the object represented by the json string""" - instance = StudyRequestRelationshipsAnalysesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into AnalysisRequest - try: - instance.actual_instance = AnalysisRequest.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into StudyRequestRelationshipsAnalysesInner with oneOf schemas: AnalysisRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into StudyRequestRelationshipsAnalysesInner with oneOf schemas: AnalysisRequest, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/study_return.py b/neurostore_sdk/models/study_return.py index 0128b3c..86f2447 100644 --- a/neurostore_sdk/models/study_return.py +++ b/neurostore_sdk/models/study_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,170 +19,192 @@ import json from datetime import datetime -from typing import Any, Dict, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, conlist, constr -from neurostore_sdk.models.study_return_all_of_studysets_inner import StudyReturnAllOfStudysetsInner +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from neurostore_sdk.models.study_return_all_of_studysets import StudyReturnAllOfStudysets from neurostore_sdk.models.study_return_relationships_analyses import StudyReturnRelationshipsAnalyses +from typing import Optional, Set +from typing_extensions import Self class StudyReturn(BaseModel): """ StudyReturn - """ - doi: Optional[StrictStr] = Field(None, description="Digital object identifier of the study.") - name: Optional[StrictStr] = Field(None, description="Title of the study.") - metadata: Optional[Dict[str, Any]] = Field(None, description="Metadata associated with the study not covered by the other study attributes.") - description: Optional[StrictStr] = Field(None, description="Long form description of the study, typically the abstract.") - publication: Optional[StrictStr] = Field(None, description="The journal/place of publication for the study.") - pmid: Optional[StrictStr] = Field(None, description="If the study was published on PubMed, place the PubMed ID here.") - authors: Optional[StrictStr] = Field(None, description="The authors on the publication of this study.") - year: Optional[conint(strict=True, le=9999, ge=0)] = Field(None, description="The year this study was published.") - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") + """ # noqa: E501 + doi: Optional[StrictStr] = Field(default=None, description="Digital object identifier of the study.") + name: Optional[StrictStr] = Field(default=None, description="Title of the study.") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="Metadata associated with the study not covered by the other study attributes.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the study, typically the abstract.") + publication: Optional[StrictStr] = Field(default=None, description="The journal/place of publication for the study.") + pmid: Optional[StrictStr] = Field(default=None, description="If the study was published on PubMed, place the PubMed ID here.") + authors: Optional[StrictStr] = Field(default=None, description="The authors on the publication of this study.") + year: Optional[Annotated[int, Field(le=9999, strict=True, ge=0)]] = Field(default=None, description="The year this study was published.") + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") source: Optional[StrictStr] = None source_id: Optional[StrictStr] = None source_updated_at: Optional[StrictStr] = None analyses: Optional[StudyReturnRelationshipsAnalyses] = None - studysets: Optional[conlist(StudyReturnAllOfStudysetsInner)] = None + studysets: Optional[List[StudyReturnAllOfStudysets]] = None has_coordinates: Optional[StrictBool] = None has_images: Optional[StrictBool] = None base_study: Optional[StrictStr] = None pmcid: Optional[StrictStr] = None - __properties = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "analyses", "studysets", "has_coordinates", "has_images", "base_study", "pmcid"] + __properties: ClassVar[List[str]] = ["doi", "name", "metadata", "description", "publication", "pmid", "authors", "year", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "analyses", "studysets", "has_coordinates", "has_images", "base_study", "pmcid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyReturn 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={ - "created_at", - "updated_at", - "user", - "source_updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + "source_updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of analyses if self.analyses: _dict['analyses'] = self.analyses.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in studysets (list) _items = [] if self.studysets: - for _item in self.studysets: - if _item: - _items.append(_item.to_dict()) + for _item_studysets in self.studysets: + if _item_studysets: + _items.append(_item_studysets.to_dict()) _dict['studysets'] = _items # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None # set to None if authors (nullable) is None - # and __fields_set__ contains the field - if self.authors is None and "authors" in self.__fields_set__: + # and model_fields_set contains the field + if self.authors is None and "authors" in self.model_fields_set: _dict['authors'] = None # set to None if year (nullable) is None - # and __fields_set__ contains the field - if self.year is None and "year" in self.__fields_set__: + # and model_fields_set contains the field + if self.year is None and "year" in self.model_fields_set: _dict['year'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_id (nullable) is None - # and __fields_set__ contains the field - if self.source_id is None and "source_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_id is None and "source_id" in self.model_fields_set: _dict['source_id'] = None # set to None if source_updated_at (nullable) is None - # and __fields_set__ contains the field - if self.source_updated_at is None and "source_updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_updated_at is None and "source_updated_at" in self.model_fields_set: _dict['source_updated_at'] = None # set to None if base_study (nullable) is None - # and __fields_set__ contains the field - if self.base_study is None and "base_study" in self.__fields_set__: + # and model_fields_set contains the field + if self.base_study is None and "base_study" in self.model_fields_set: _dict['base_study'] = 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__: + # and model_fields_set contains the field + if self.pmcid is None and "pmcid" in self.model_fields_set: _dict['pmcid'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyReturn.parse_obj({ + _obj = cls.model_validate({ "doi": obj.get("doi"), "name": obj.get("name"), "metadata": obj.get("metadata"), @@ -200,8 +222,8 @@ def from_dict(cls, obj: dict) -> StudyReturn: "source": obj.get("source"), "source_id": obj.get("source_id"), "source_updated_at": obj.get("source_updated_at"), - "analyses": StudyReturnRelationshipsAnalyses.from_dict(obj.get("analyses")) if obj.get("analyses") is not None else None, - "studysets": [StudyReturnAllOfStudysetsInner.from_dict(_item) for _item in obj.get("studysets")] if obj.get("studysets") is not None else None, + "analyses": StudyReturnRelationshipsAnalyses.from_dict(obj["analyses"]) if obj.get("analyses") is not None else None, + "studysets": [StudyReturnAllOfStudysets.from_dict(_item) for _item in obj["studysets"]] if obj.get("studysets") is not None else None, "has_coordinates": obj.get("has_coordinates"), "has_images": obj.get("has_images"), "base_study": obj.get("base_study"), @@ -209,3 +231,4 @@ def from_dict(cls, obj: dict) -> StudyReturn: }) return _obj + diff --git a/neurostore_sdk/models/study_return_all_of.py b/neurostore_sdk/models/study_return_all_of.py deleted file mode 100644 index 11bc315..0000000 --- a/neurostore_sdk/models/study_return_all_of.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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 List, Optional -from pydantic import BaseModel, StrictBool, StrictStr, conlist -from neurostore_sdk.models.study_return_all_of_studysets_inner import StudyReturnAllOfStudysetsInner - -class StudyReturnAllOf(BaseModel): - """ - StudyReturnAllOf - """ - studysets: Optional[conlist(StudyReturnAllOfStudysetsInner)] = None - has_coordinates: Optional[StrictBool] = None - has_images: Optional[StrictBool] = None - base_study: Optional[StrictStr] = None - pmcid: Optional[StrictStr] = None - __properties = ["studysets", "has_coordinates", "has_images", "base_study", "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) -> StudyReturnAllOf: - """Create an instance of StudyReturnAllOf 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) - # override the default output from pydantic by calling `to_dict()` of each item in studysets (list) - _items = [] - if self.studysets: - for _item in self.studysets: - if _item: - _items.append(_item.to_dict()) - _dict['studysets'] = _items - # set to None if base_study (nullable) is None - # and __fields_set__ contains the field - if self.base_study is None and "base_study" in self.__fields_set__: - _dict['base_study'] = 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 - def from_dict(cls, obj: dict) -> StudyReturnAllOf: - """Create an instance of StudyReturnAllOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return StudyReturnAllOf.parse_obj(obj) - - _obj = StudyReturnAllOf.parse_obj({ - "studysets": [StudyReturnAllOfStudysetsInner.from_dict(_item) for _item in obj.get("studysets")] if obj.get("studysets") is not None else None, - "has_coordinates": obj.get("has_coordinates"), - "has_images": obj.get("has_images"), - "base_study": obj.get("base_study"), - "pmcid": obj.get("pmcid") - }) - return _obj - diff --git a/neurostore_sdk/models/study_return_all_of_studysets.py b/neurostore_sdk/models/study_return_all_of_studysets.py index 0519ce3..ed49dd3 100644 --- a/neurostore_sdk/models/study_return_all_of_studysets.py +++ b/neurostore_sdk/models/study_return_all_of_studysets.py @@ -3,73 +3,139 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -import pprint -import re # noqa: F401 import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from neurostore_sdk.models.study_return_all_of_studysets_one_of import StudyReturnAllOfStudysetsOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self - -from typing import Optional -from pydantic import BaseModel, StrictStr +STUDYRETURNALLOFSTUDYSETS_ONE_OF_SCHEMAS = ["StudyReturnAllOfStudysetsOneOf", "str"] class StudyReturnAllOfStudysets(BaseModel): """ StudyReturnAllOfStudysets """ - name: Optional[StrictStr] = None - id: Optional[StrictStr] = None - description: Optional[StrictStr] = None - __properties = ["name", "id", "description"] - - 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()) + # data type: StudyReturnAllOfStudysetsOneOf + oneof_schema_1_validator: Optional[StudyReturnAllOfStudysetsOneOf] = None + # data type: str + oneof_schema_2_validator: Optional[StrictStr] = None + actual_instance: Optional[Union[StudyReturnAllOfStudysetsOneOf, str]] = None + one_of_schemas: Set[str] = { "StudyReturnAllOfStudysetsOneOf", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = StudyReturnAllOfStudysets.model_construct() + error_messages = [] + match = 0 + # validate data type: StudyReturnAllOfStudysetsOneOf + if not isinstance(v, StudyReturnAllOfStudysetsOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `StudyReturnAllOfStudysetsOneOf`") + else: + match += 1 + # validate data type: str + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in StudyReturnAllOfStudysets with oneOf schemas: StudyReturnAllOfStudysetsOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in StudyReturnAllOfStudysets with oneOf schemas: StudyReturnAllOfStudysetsOneOf, str. Details: " + ", ".join(error_messages)) + else: + return v @classmethod - def from_json(cls, json_str: str) -> StudyReturnAllOfStudysets: - """Create an instance of StudyReturnAllOfStudysets 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) - return _dict + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: dict) -> StudyReturnAllOfStudysets: - """Create an instance of StudyReturnAllOfStudysets from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into StudyReturnAllOfStudysetsOneOf + try: + instance.actual_instance = StudyReturnAllOfStudysetsOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into str + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into StudyReturnAllOfStudysets with oneOf schemas: StudyReturnAllOfStudysetsOneOf, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into StudyReturnAllOfStudysets with oneOf schemas: StudyReturnAllOfStudysetsOneOf, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], StudyReturnAllOfStudysetsOneOf, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return StudyReturnAllOfStudysets.parse_obj(obj) + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) - _obj = StudyReturnAllOfStudysets.parse_obj({ - "name": obj.get("name"), - "id": obj.get("id"), - "description": obj.get("description") - }) - return _obj diff --git a/neurostore_sdk/models/study_return_all_of_studysets_inner.py b/neurostore_sdk/models/study_return_all_of_studysets_inner.py deleted file mode 100644 index 3b130f4..0000000 --- a/neurostore_sdk/models/study_return_all_of_studysets_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.study_return_all_of_studysets_inner_one_of import StudyReturnAllOfStudysetsInnerOneOf -from typing import Any, List -from pydantic import StrictStr, Field - -STUDYRETURNALLOFSTUDYSETSINNER_ONE_OF_SCHEMAS = ["StudyReturnAllOfStudysetsInnerOneOf", "str"] - -class StudyReturnAllOfStudysetsInner(BaseModel): - """ - StudyReturnAllOfStudysetsInner - """ - # data type: StudyReturnAllOfStudysetsInnerOneOf - oneof_schema_1_validator: Optional[StudyReturnAllOfStudysetsInnerOneOf] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYRETURNALLOFSTUDYSETSINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = StudyReturnAllOfStudysetsInner.construct() - error_messages = [] - match = 0 - # validate data type: StudyReturnAllOfStudysetsInnerOneOf - if not isinstance(v, StudyReturnAllOfStudysetsInnerOneOf): - error_messages.append(f"Error! Input type `{type(v)}` is not `StudyReturnAllOfStudysetsInnerOneOf`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in StudyReturnAllOfStudysetsInner with oneOf schemas: StudyReturnAllOfStudysetsInnerOneOf, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in StudyReturnAllOfStudysetsInner with oneOf schemas: StudyReturnAllOfStudysetsInnerOneOf, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> StudyReturnAllOfStudysetsInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> StudyReturnAllOfStudysetsInner: - """Returns the object represented by the json string""" - instance = StudyReturnAllOfStudysetsInner.construct() - error_messages = [] - match = 0 - - # deserialize data into StudyReturnAllOfStudysetsInnerOneOf - try: - instance.actual_instance = StudyReturnAllOfStudysetsInnerOneOf.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into StudyReturnAllOfStudysetsInner with oneOf schemas: StudyReturnAllOfStudysetsInnerOneOf, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into StudyReturnAllOfStudysetsInner with oneOf schemas: StudyReturnAllOfStudysetsInnerOneOf, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/study_return_all_of_studysets_inner_one_of.py b/neurostore_sdk/models/study_return_all_of_studysets_inner_one_of.py deleted file mode 100644 index 91e8499..0000000 --- a/neurostore_sdk/models/study_return_all_of_studysets_inner_one_of.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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 StudyReturnAllOfStudysetsInnerOneOf(BaseModel): - """ - StudyReturnAllOfStudysetsInnerOneOf - """ - name: Optional[StrictStr] = None - id: Optional[StrictStr] = None - description: Optional[StrictStr] = None - __properties = ["name", "id", "description"] - - 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) -> StudyReturnAllOfStudysetsInnerOneOf: - """Create an instance of StudyReturnAllOfStudysetsInnerOneOf 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 name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: - _dict['name'] = None - - # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: - _dict['description'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> StudyReturnAllOfStudysetsInnerOneOf: - """Create an instance of StudyReturnAllOfStudysetsInnerOneOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return StudyReturnAllOfStudysetsInnerOneOf.parse_obj(obj) - - _obj = StudyReturnAllOfStudysetsInnerOneOf.parse_obj({ - "name": obj.get("name"), - "id": obj.get("id"), - "description": obj.get("description") - }) - return _obj - diff --git a/neurostore_sdk/models/study_return_all_of_studysets_one_of.py b/neurostore_sdk/models/study_return_all_of_studysets_one_of.py new file mode 100644 index 0000000..3073fbf --- /dev/null +++ b/neurostore_sdk/models/study_return_all_of_studysets_one_of.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class StudyReturnAllOfStudysetsOneOf(BaseModel): + """ + StudyReturnAllOfStudysetsOneOf + """ # noqa: E501 + name: Optional[StrictStr] = None + id: Optional[StrictStr] = None + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name", "id", "description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StudyReturnAllOfStudysetsOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StudyReturnAllOfStudysetsOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "id": obj.get("id"), + "description": obj.get("description") + }) + return _obj + + diff --git a/neurostore_sdk/models/study_return_relationships.py b/neurostore_sdk/models/study_return_relationships.py index 8662ad4..cca0e6c 100644 --- a/neurostore_sdk/models/study_return_relationships.py +++ b/neurostore_sdk/models/study_return_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.study_return_relationships_analyses import StudyReturnRelationshipsAnalyses +from typing import Optional, Set +from typing_extensions import Self class StudyReturnRelationships(BaseModel): """ StudyReturnRelationships - """ + """ # noqa: E501 analyses: Optional[StudyReturnRelationshipsAnalyses] = None - __properties = ["analyses"] + __properties: ClassVar[List[str]] = ["analyses"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudyReturnRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudyReturnRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of analyses if self.analyses: _dict['analyses'] = self.analyses.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> StudyReturnRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudyReturnRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudyReturnRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudyReturnRelationships.parse_obj({ - "analyses": StudyReturnRelationshipsAnalyses.from_dict(obj.get("analyses")) if obj.get("analyses") is not None else None + _obj = cls.model_validate({ + "analyses": StudyReturnRelationshipsAnalyses.from_dict(obj["analyses"]) if obj.get("analyses") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/study_return_relationships_analyses.py b/neurostore_sdk/models/study_return_relationships_analyses.py index 43faa9e..8db6bda 100644 --- a/neurostore_sdk/models/study_return_relationships_analyses.py +++ b/neurostore_sdk/models/study_return_relationships_analyses.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.analysis_return import AnalysisReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self STUDYRETURNRELATIONSHIPSANALYSES_ONE_OF_SCHEMAS = ["List[AnalysisReturn]", "List[str]"] @@ -32,16 +31,19 @@ class StudyReturnRelationshipsAnalyses(BaseModel): StudyReturnRelationshipsAnalyses """ # data type: List[AnalysisReturn] - oneof_schema_1_validator: Optional[conlist(AnalysisReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[AnalysisReturn], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYRETURNRELATIONSHIPSANALYSES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[AnalysisReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[AnalysisReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = StudyReturnRelationshipsAnalyses.construct() + instance = StudyReturnRelationshipsAnalyses.model_construct() error_messages = [] match = 0 # validate data type: List[AnalysisReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> StudyReturnRelationshipsAnalyses: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> StudyReturnRelationshipsAnalyses: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = StudyReturnRelationshipsAnalyses.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[AnalysisReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/study_return_relationships_analyses_inner.py b/neurostore_sdk/models/study_return_relationships_analyses_inner.py deleted file mode 100644 index 5165bab..0000000 --- a/neurostore_sdk/models/study_return_relationships_analyses_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.analysis_return import AnalysisReturn -from typing import Any, List -from pydantic import StrictStr, Field - -STUDYRETURNRELATIONSHIPSANALYSESINNER_ONE_OF_SCHEMAS = ["AnalysisReturn", "str"] - -class StudyReturnRelationshipsAnalysesInner(BaseModel): - """ - StudyReturnRelationshipsAnalysesInner - """ - # data type: AnalysisReturn - oneof_schema_1_validator: Optional[AnalysisReturn] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYRETURNRELATIONSHIPSANALYSESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = StudyReturnRelationshipsAnalysesInner.construct() - error_messages = [] - match = 0 - # validate data type: AnalysisReturn - if not isinstance(v, AnalysisReturn): - error_messages.append(f"Error! Input type `{type(v)}` is not `AnalysisReturn`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in StudyReturnRelationshipsAnalysesInner with oneOf schemas: AnalysisReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in StudyReturnRelationshipsAnalysesInner with oneOf schemas: AnalysisReturn, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> StudyReturnRelationshipsAnalysesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> StudyReturnRelationshipsAnalysesInner: - """Returns the object represented by the json string""" - instance = StudyReturnRelationshipsAnalysesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into AnalysisReturn - try: - instance.actual_instance = AnalysisReturn.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into StudyReturnRelationshipsAnalysesInner with oneOf schemas: AnalysisReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into StudyReturnRelationshipsAnalysesInner with oneOf schemas: AnalysisReturn, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/studyset_base.py b/neurostore_sdk/models/studyset_base.py index 16384ce..359bfa2 100644 --- a/neurostore_sdk/models/studyset_base.py +++ b/neurostore_sdk/models/studyset_base.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,82 +18,98 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StudysetBase(BaseModel): """ StudysetBase - """ - name: Optional[StrictStr] = Field(None, description="Descriptive and human readable name of the studyset.") - description: Optional[StrictStr] = Field(None, description="A longform description of the studyset.") - publication: Optional[StrictStr] = Field(None, description="The journal/source the studyset is connected to if the studyset was published.") - doi: Optional[StrictStr] = Field(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).") - pmid: Optional[StrictStr] = Field(None, description="If the article connected to the studyset was published on PubMed, then link the ID here.") - __properties = ["name", "description", "publication", "doi", "pmid"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Descriptive and human readable name of the studyset.") + description: Optional[StrictStr] = Field(default=None, description="A longform description of the studyset.") + publication: Optional[StrictStr] = Field(default=None, description="The journal/source the studyset is connected to if the studyset was published.") + 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).") + pmid: Optional[StrictStr] = Field(default=None, description="If the article connected to the studyset was published on PubMed, then link the ID here.") + __properties: ClassVar[List[str]] = ["name", "description", "publication", "doi", "pmid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetBase: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetBase 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetBase: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetBase from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetBase.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetBase.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "publication": obj.get("publication"), @@ -102,3 +118,4 @@ def from_dict(cls, obj: dict) -> StudysetBase: }) return _obj + diff --git a/neurostore_sdk/models/studyset_list.py b/neurostore_sdk/models/studyset_list.py index 827460f..51fa0db 100644 --- a/neurostore_sdk/models/studyset_list.py +++ b/neurostore_sdk/models/studyset_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist -from neurostore_sdk.models.metadata import Metadata +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.studyset_return import StudysetReturn +from typing import Optional, Set +from typing_extensions import Self class StudysetList(BaseModel): """ StudysetList - """ - results: Optional[conlist(StudysetReturn)] = None + """ # noqa: E501 + results: Optional[List[StudysetReturn]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetList.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetList.parse_obj({ - "results": [StudysetReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [StudysetReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/studyset_request.py b/neurostore_sdk/models/studyset_request.py index 81ff75e..5bd1697 100644 --- a/neurostore_sdk/models/studyset_request.py +++ b/neurostore_sdk/models/studyset_request.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,96 +18,113 @@ import re # noqa: F401 import json - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class StudysetRequest(BaseModel): """ StudysetRequest - """ - name: Optional[StrictStr] = Field(None, description="Descriptive and human readable name of the studyset.") - description: Optional[StrictStr] = Field(None, description="A longform description of the studyset.") - publication: Optional[StrictStr] = Field(None, description="The journal/source the studyset is connected to if the studyset was published.") - doi: Optional[StrictStr] = Field(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).") - pmid: Optional[StrictStr] = Field(None, description="If the article connected to the studyset was published on PubMed, then link the ID here.") - studies: Optional[conlist(Any)] = None - id: Optional[constr(strict=True, max_length=30, 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") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Descriptive and human readable name of the studyset.") + description: Optional[StrictStr] = Field(default=None, description="A longform description of the studyset.") + publication: Optional[StrictStr] = Field(default=None, description="The journal/source the studyset is connected to if the studyset was published.") + 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).") + pmid: Optional[StrictStr] = Field(default=None, description="If the article connected to the studyset was published on PubMed, then link the ID here.") + studies: Optional[List[Dict[str, Any]]] = None + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") level: Optional[StrictStr] = None - __properties = ["name", "description", "publication", "doi", "pmid", "studies", "id", "public", "level"] + __properties: ClassVar[List[str]] = ["name", "description", "publication", "doi", "pmid", "studies", "id", "public", "level"] - @validator('level') + @field_validator('level') def level_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in ('group', 'meta'): + if value not in set(['group', 'meta']): raise ValueError("must be one of enum values ('group', 'meta')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetRequest 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "publication": obj.get("publication"), @@ -120,3 +137,4 @@ def from_dict(cls, obj: dict) -> StudysetRequest: }) return _obj + diff --git a/neurostore_sdk/models/studyset_request_relationships.py b/neurostore_sdk/models/studyset_request_relationships.py index dff71b4..39bf3c0 100644 --- a/neurostore_sdk/models/studyset_request_relationships.py +++ b/neurostore_sdk/models/studyset_request_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,54 +18,71 @@ import re # noqa: F401 import json - -from typing import Any, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StudysetRequestRelationships(BaseModel): """ StudysetRequestRelationships - """ - studies: Optional[conlist(Any)] = None - __properties = ["studies"] + """ # noqa: E501 + studies: Optional[List[Any]] = None + __properties: ClassVar[List[str]] = ["studies"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetRequestRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetRequestRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetRequestRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetRequestRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetRequestRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetRequestRelationships.parse_obj({ + _obj = cls.model_validate({ "studies": obj.get("studies") }) return _obj + diff --git a/neurostore_sdk/models/studyset_request_relationships_studies.py b/neurostore_sdk/models/studyset_request_relationships_studies.py deleted file mode 100644 index 581a87f..0000000 --- a/neurostore_sdk/models/studyset_request_relationships_studies.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator -from neurostore_sdk.models.study_request import StudyRequest -from typing import Any, List -from pydantic import StrictStr, Field - -STUDYSETREQUESTRELATIONSHIPSSTUDIES_ONE_OF_SCHEMAS = ["List[StudyRequest]", "List[str]"] - -class StudysetRequestRelationshipsStudies(BaseModel): - """ - StudysetRequestRelationshipsStudies - """ - # data type: List[StudyRequest] - oneof_schema_1_validator: Optional[conlist(StudyRequest, min_items=1)] = None - # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYSETREQUESTRELATIONSHIPSSTUDIES_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = StudysetRequestRelationshipsStudies.construct() - error_messages = [] - match = 0 - # validate data type: List[StudyRequest] - try: - instance.oneof_schema_1_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # validate data type: List[str] - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in StudysetRequestRelationshipsStudies with oneOf schemas: List[StudyRequest], List[str]. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in StudysetRequestRelationshipsStudies with oneOf schemas: List[StudyRequest], List[str]. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> StudysetRequestRelationshipsStudies: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> StudysetRequestRelationshipsStudies: - """Returns the object represented by the json string""" - instance = StudysetRequestRelationshipsStudies.construct() - error_messages = [] - match = 0 - - # deserialize data into List[StudyRequest] - try: - # validation - instance.oneof_schema_1_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_1_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into List[str] - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into StudysetRequestRelationshipsStudies with oneOf schemas: List[StudyRequest], List[str]. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into StudysetRequestRelationshipsStudies with oneOf schemas: List[StudyRequest], List[str]. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/studyset_request_relationships_studies_inner.py b/neurostore_sdk/models/studyset_request_relationships_studies_inner.py deleted file mode 100644 index ce88499..0000000 --- a/neurostore_sdk/models/studyset_request_relationships_studies_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.study_request import StudyRequest -from typing import Any, List -from pydantic import StrictStr, Field - -STUDYSETREQUESTRELATIONSHIPSSTUDIESINNER_ONE_OF_SCHEMAS = ["StudyRequest", "str"] - -class StudysetRequestRelationshipsStudiesInner(BaseModel): - """ - StudysetRequestRelationshipsStudiesInner - """ - # data type: StudyRequest - oneof_schema_1_validator: Optional[StudyRequest] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYSETREQUESTRELATIONSHIPSSTUDIESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = StudysetRequestRelationshipsStudiesInner.construct() - error_messages = [] - match = 0 - # validate data type: StudyRequest - if not isinstance(v, StudyRequest): - error_messages.append(f"Error! Input type `{type(v)}` is not `StudyRequest`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in StudysetRequestRelationshipsStudiesInner with oneOf schemas: StudyRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in StudysetRequestRelationshipsStudiesInner with oneOf schemas: StudyRequest, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> StudysetRequestRelationshipsStudiesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> StudysetRequestRelationshipsStudiesInner: - """Returns the object represented by the json string""" - instance = StudysetRequestRelationshipsStudiesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into StudyRequest - try: - instance.actual_instance = StudyRequest.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into StudysetRequestRelationshipsStudiesInner with oneOf schemas: StudyRequest, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into StudysetRequestRelationshipsStudiesInner with oneOf schemas: StudyRequest, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/studyset_return.py b/neurostore_sdk/models/studyset_return.py index 73905a1..d682540 100644 --- a/neurostore_sdk/models/studyset_return.py +++ b/neurostore_sdk/models/studyset_return.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,140 +19,162 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr, validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies +from typing import Optional, Set +from typing_extensions import Self class StudysetReturn(BaseModel): """ StudysetReturn - """ - name: Optional[StrictStr] = Field(None, description="Descriptive and human readable name of the studyset.") - description: Optional[StrictStr] = Field(None, description="A longform description of the studyset.") - publication: Optional[StrictStr] = Field(None, description="The journal/source the studyset is connected to if the studyset was published.") - doi: Optional[StrictStr] = Field(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).") - pmid: Optional[StrictStr] = Field(None, description="If the article connected to the studyset was published on PubMed, then link the ID here.") - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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") - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Descriptive and human readable name of the studyset.") + description: Optional[StrictStr] = Field(default=None, description="A longform description of the studyset.") + publication: Optional[StrictStr] = Field(default=None, description="The journal/source the studyset is connected to if the studyset was published.") + 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).") + pmid: Optional[StrictStr] = Field(default=None, description="If the article connected to the studyset was published on PubMed, then link the ID here.") + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + user: Optional[StrictStr] = Field(default=None, description="who owns the resource") + username: Optional[StrictStr] = Field(default=None, description="human readable username") source: Optional[StrictStr] = None source_id: Optional[StrictStr] = None source_updated_at: Optional[StrictStr] = None studies: Optional[StudysetReturnRelationshipsStudies] = None level: Optional[StrictStr] = None - __properties = ["name", "description", "publication", "doi", "pmid", "created_at", "updated_at", "id", "public", "user", "username", "source", "source_id", "source_updated_at", "studies", "level"] + __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"] - @validator('level') + @field_validator('level') def level_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in ('group', 'meta'): + if value not in set(['group', 'meta']): raise ValueError("must be one of enum values ('group', 'meta')") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetReturn 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={ - "created_at", - "updated_at", - "user", - "source_updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + "user", + "source_updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of studies if self.studies: _dict['studies'] = self.studies.to_dict() # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict['name'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if publication (nullable) is None - # and __fields_set__ contains the field - if self.publication is None and "publication" in self.__fields_set__: + # and model_fields_set contains the field + if self.publication is None and "publication" in self.model_fields_set: _dict['publication'] = None # set to None if doi (nullable) is None - # and __fields_set__ contains the field - if self.doi is None and "doi" in self.__fields_set__: + # and model_fields_set contains the field + if self.doi is None and "doi" in self.model_fields_set: _dict['doi'] = None # set to None if pmid (nullable) is None - # and __fields_set__ contains the field - if self.pmid is None and "pmid" in self.__fields_set__: + # and model_fields_set contains the field + if self.pmid is None and "pmid" in self.model_fields_set: _dict['pmid'] = None # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: + # and model_fields_set contains the field + if self.username is None and "username" in self.model_fields_set: _dict['username'] = None # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_id (nullable) is None - # and __fields_set__ contains the field - if self.source_id is None and "source_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_id is None and "source_id" in self.model_fields_set: _dict['source_id'] = None # set to None if source_updated_at (nullable) is None - # and __fields_set__ contains the field - if self.source_updated_at is None and "source_updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_updated_at is None and "source_updated_at" in self.model_fields_set: _dict['source_updated_at'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetReturn.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "publication": obj.get("publication"), @@ -167,8 +189,9 @@ def from_dict(cls, obj: dict) -> StudysetReturn: "source": obj.get("source"), "source_id": obj.get("source_id"), "source_updated_at": obj.get("source_updated_at"), - "studies": StudysetReturnRelationshipsStudies.from_dict(obj.get("studies")) if obj.get("studies") is not None else None, + "studies": StudysetReturnRelationshipsStudies.from_dict(obj["studies"]) if obj.get("studies") is not None else None, "level": obj.get("level") }) return _obj + diff --git a/neurostore_sdk/models/studyset_return_relationships.py b/neurostore_sdk/models/studyset_return_relationships.py index bc42ee4..56bc9b9 100644 --- a/neurostore_sdk/models/studyset_return_relationships.py +++ b/neurostore_sdk/models/studyset_return_relationships.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies +from typing import Optional, Set +from typing_extensions import Self class StudysetReturnRelationships(BaseModel): """ StudysetReturnRelationships - """ + """ # noqa: E501 studies: Optional[StudysetReturnRelationshipsStudies] = None - __properties = ["studies"] + __properties: ClassVar[List[str]] = ["studies"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetReturnRelationships: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetReturnRelationships 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of studies if self.studies: _dict['studies'] = self.studies.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetReturnRelationships: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetReturnRelationships from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetReturnRelationships.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetReturnRelationships.parse_obj({ - "studies": StudysetReturnRelationshipsStudies.from_dict(obj.get("studies")) if obj.get("studies") is not None else None + _obj = cls.model_validate({ + "studies": StudysetReturnRelationshipsStudies.from_dict(obj["studies"]) if obj.get("studies") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/studyset_return_relationships_studies.py b/neurostore_sdk/models/studyset_return_relationships_studies.py index f5acca8..771675f 100644 --- a/neurostore_sdk/models/studyset_return_relationships_studies.py +++ b/neurostore_sdk/models/studyset_return_relationships_studies.py @@ -3,27 +3,26 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations -from inspect import getfullargspec import json import pprint -import re # noqa: F401 - +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator +from typing_extensions import Annotated from neurostore_sdk.models.study_return import StudyReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self STUDYSETRETURNRELATIONSHIPSSTUDIES_ONE_OF_SCHEMAS = ["List[StudyReturn]", "List[str]"] @@ -32,16 +31,19 @@ class StudysetReturnRelationshipsStudies(BaseModel): StudysetReturnRelationshipsStudies """ # data type: List[StudyReturn] - oneof_schema_1_validator: Optional[conlist(StudyReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[StudyReturn], Field(min_length=1)]] = None # data type: List[str] - oneof_schema_2_validator: Optional[conlist(StrictStr)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYSETRETURNRELATIONSHIPSSTUDIES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[StudyReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[StudyReturn]", "List[str]" } - class Config: - validate_assignment = True + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, *args, **kwargs): + + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") @@ -51,9 +53,9 @@ def __init__(self, *args, **kwargs): else: super().__init__(**kwargs) - @validator('actual_instance') + @field_validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = StudysetReturnRelationshipsStudies.construct() + instance = StudysetReturnRelationshipsStudies.model_construct() error_messages = [] match = 0 # validate data type: List[StudyReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> StudysetReturnRelationshipsStudies: + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> StudysetReturnRelationshipsStudies: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = StudysetReturnRelationshipsStudies.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -121,19 +123,17 @@ def to_json(self) -> str: if self.actual_instance is None: return "null" - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): return self.actual_instance.to_json() else: return json.dumps(self.actual_instance) - def to_dict(self) -> dict: + def to_dict(self) -> Optional[Union[Dict[str, Any], List[StudyReturn], List[str]]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): return self.actual_instance.to_dict() else: # primitive type @@ -141,5 +141,6 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) + return pprint.pformat(self.model_dump()) + diff --git a/neurostore_sdk/models/studyset_return_relationships_studies_inner.py b/neurostore_sdk/models/studyset_return_relationships_studies_inner.py deleted file mode 100644 index 25efa62..0000000 --- a/neurostore_sdk/models/studyset_return_relationships_studies_inner.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" - - -from __future__ import annotations -from inspect import getfullargspec -import json -import pprint -import re # noqa: F401 - -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, ValidationError, validator -from neurostore_sdk.models.study_return import StudyReturn -from typing import Any, List -from pydantic import StrictStr, Field - -STUDYSETRETURNRELATIONSHIPSSTUDIESINNER_ONE_OF_SCHEMAS = ["StudyReturn", "str"] - -class StudysetReturnRelationshipsStudiesInner(BaseModel): - """ - StudysetReturnRelationshipsStudiesInner - """ - # data type: StudyReturn - oneof_schema_1_validator: Optional[StudyReturn] = None - # data type: str - oneof_schema_2_validator: Optional[StrictStr] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYSETRETURNRELATIONSHIPSSTUDIESINNER_ONE_OF_SCHEMAS, const=True) - - class Config: - validate_assignment = True - - def __init__(self, *args, **kwargs): - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @validator('actual_instance') - def actual_instance_must_validate_oneof(cls, v): - instance = StudysetReturnRelationshipsStudiesInner.construct() - error_messages = [] - match = 0 - # validate data type: StudyReturn - if not isinstance(v, StudyReturn): - error_messages.append(f"Error! Input type `{type(v)}` is not `StudyReturn`") - else: - match += 1 - # validate data type: str - try: - instance.oneof_schema_2_validator = v - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in StudysetReturnRelationshipsStudiesInner with oneOf schemas: StudyReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when setting `actual_instance` in StudysetReturnRelationshipsStudiesInner with oneOf schemas: StudyReturn, str. Details: " + ", ".join(error_messages)) - else: - return v - - @classmethod - def from_dict(cls, obj: dict) -> StudysetReturnRelationshipsStudiesInner: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> StudysetReturnRelationshipsStudiesInner: - """Returns the object represented by the json string""" - instance = StudysetReturnRelationshipsStudiesInner.construct() - error_messages = [] - match = 0 - - # deserialize data into StudyReturn - try: - instance.actual_instance = StudyReturn.from_json(json_str) - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - # deserialize data into str - try: - # validation - instance.oneof_schema_2_validator = json.loads(json_str) - # assign value to actual_instance - instance.actual_instance = instance.oneof_schema_2_validator - match += 1 - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if match > 1: - # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into StudysetReturnRelationshipsStudiesInner with oneOf schemas: StudyReturn, str. Details: " + ", ".join(error_messages)) - elif match == 0: - # no match - raise ValueError("No match found when deserializing the JSON string into StudysetReturnRelationshipsStudiesInner with oneOf schemas: StudyReturn, str. Details: " + ", ".join(error_messages)) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - to_json = getattr(self.actual_instance, "to_json", None) - if callable(to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict(self) -> dict: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - to_dict = getattr(self.actual_instance, "to_dict", None) - if callable(to_dict): - return self.actual_instance.to_dict() - else: - # primitive type - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.dict()) - diff --git a/neurostore_sdk/models/studysets_id_get404_response.py b/neurostore_sdk/models/studysets_id_get404_response.py index bd56c9c..aa73f53 100644 --- a/neurostore_sdk/models/studysets_id_get404_response.py +++ b/neurostore_sdk/models/studysets_id_get404_response.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,66 +18,82 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr, validator +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StudysetsIdGet404Response(BaseModel): """ StudysetsIdGet404Response - """ + """ # noqa: E501 detail: Optional[StrictStr] = None status: Optional[StrictInt] = None title: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["detail", "status", "title", "type"] + __properties: ClassVar[List[str]] = ["detail", "status", "title", "type"] - @validator('status') + @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in (404): + if value not in set([404]): raise ValueError("must be one of enum values (404)") return value - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetsIdGet404Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetsIdGet404Response 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetsIdGet404Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetsIdGet404Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetsIdGet404Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetsIdGet404Response.parse_obj({ + _obj = cls.model_validate({ "detail": obj.get("detail"), "status": obj.get("status"), "title": obj.get("title"), @@ -85,3 +101,4 @@ def from_dict(cls, obj: dict) -> StudysetsIdGet404Response: }) return _obj + diff --git a/neurostore_sdk/models/studysets_id_put422_response.py b/neurostore_sdk/models/studysets_id_put422_response.py index bc19e49..d10bca8 100644 --- a/neurostore_sdk/models/studysets_id_put422_response.py +++ b/neurostore_sdk/models/studysets_id_put422_response.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,56 +18,72 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class StudysetsIdPut422Response(BaseModel): """ StudysetsIdPut422Response - """ + """ # noqa: E501 detail: Optional[StrictStr] = None status: Optional[StrictInt] = None title: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["detail", "status", "title", "type"] + __properties: ClassVar[List[str]] = ["detail", "status", "title", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StudysetsIdPut422Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetsIdPut422Response 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetsIdPut422Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetsIdPut422Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetsIdPut422Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetsIdPut422Response.parse_obj({ + _obj = cls.model_validate({ "detail": obj.get("detail"), "status": obj.get("status"), "title": obj.get("title"), @@ -75,3 +91,4 @@ def from_dict(cls, obj: dict) -> StudysetsIdPut422Response: }) return _obj + diff --git a/neurostore_sdk/models/user.py b/neurostore_sdk/models/user.py index a0780e8..d7a64b4 100644 --- a/neurostore_sdk/models/user.py +++ b/neurostore_sdk/models/user.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,56 +18,73 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self class User(BaseModel): """ - """ - name: Optional[StrictStr] = Field(None, description="full name of user") + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="full name of user") neuroid: Optional[StrictStr] = None - __properties = ["name", "neuroid"] + __properties: ClassVar[List[str]] = ["name", "neuroid"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> User: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of User 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> User: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of User from a dict""" if obj is None: return None if not isinstance(obj, dict): - return User.parse_obj(obj) + return cls.model_validate(obj) - _obj = User.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "neuroid": obj.get("neuroid") }) return _obj + diff --git a/neurostore_sdk/models/user_list.py b/neurostore_sdk/models/user_list.py index 7c5deda..27a2a26 100644 --- a/neurostore_sdk/models/user_list.py +++ b/neurostore_sdk/models/user_list.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -18,50 +18,65 @@ import re # noqa: F401 import json - -from typing import List, Optional -from pydantic import BaseModel, conlist -from neurostore_sdk.models.metadata import Metadata +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurostore_sdk.models.user import User +from typing import Optional, Set +from typing_extensions import Self class UserList(BaseModel): """ UserList - """ - results: Optional[conlist(User)] = None + """ # noqa: E501 + results: Optional[List[User]] = None metadata: Optional[Metadata] = None - __properties = ["results", "metadata"] + __properties: ClassVar[List[str]] = ["results", "metadata"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserList 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) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # override the default output from pydantic by calling `to_dict()` of metadata if self.metadata: @@ -69,17 +84,18 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> UserList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserList.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserList.parse_obj({ - "results": [User.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, - "metadata": Metadata.from_dict(obj.get("metadata")) if obj.get("metadata") is not None else None + _obj = cls.model_validate({ + "results": [User.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, + "metadata": Metadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None }) return _obj + diff --git a/neurostore_sdk/models/user_resource_attributes.py b/neurostore_sdk/models/user_resource_attributes.py deleted file mode 100644 index 27115b3..0000000 --- a/neurostore_sdk/models/user_resource_attributes.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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, Field, StrictStr - -class UserResourceAttributes(BaseModel): - """ - common resource attributes - """ - user: Optional[StrictStr] = Field(None, description="who owns the resource") - username: Optional[StrictStr] = Field(None, description="human readable username") - __properties = ["user", "username"] - - 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) -> UserResourceAttributes: - """Create an instance of UserResourceAttributes 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={ - "user", - }, - exclude_none=True) - # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: - _dict['user'] = None - - # set to None if username (nullable) is None - # and __fields_set__ contains the field - if self.username is None and "username" in self.__fields_set__: - _dict['username'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> UserResourceAttributes: - """Create an instance of UserResourceAttributes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return UserResourceAttributes.parse_obj(obj) - - _obj = UserResourceAttributes.parse_obj({ - "user": obj.get("user"), - "username": obj.get("username") - }) - return _obj - diff --git a/neurostore_sdk/models/userless_resource_attributes.py b/neurostore_sdk/models/userless_resource_attributes.py index 9bdad34..50b8f43 100644 --- a/neurostore_sdk/models/userless_resource_attributes.py +++ b/neurostore_sdk/models/userless_resource_attributes.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from __future__ import annotations @@ -19,62 +19,82 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class UserlessResourceAttributes(BaseModel): """ common resource attributes not tied to a specific user - """ - created_at: Optional[datetime] = Field(None, description="time the resource was created on the database") - updated_at: Optional[StrictStr] = Field(None, description="when the resource was last modified/updated.") - id: Optional[constr(strict=True, max_length=30, 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 = ["created_at", "updated_at", "id", "public"] + """ # noqa: E501 + created_at: Optional[datetime] = Field(default=None, description="time the resource was created on the database") + updated_at: Optional[StrictStr] = Field(default=None, description="when the resource was last modified/updated.") + 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") + public: Optional[StrictBool] = Field(default=True, description="whether the resource is listed in public searches or not") + __properties: ClassVar[List[str]] = ["created_at", "updated_at", "id", "public"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - 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)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserlessResourceAttributes: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserlessResourceAttributes 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={ - "created_at", - "updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if updated_at (nullable) is None - # and __fields_set__ contains the field - if self.updated_at is None and "updated_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: _dict['updated_at'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UserlessResourceAttributes: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserlessResourceAttributes from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserlessResourceAttributes.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserlessResourceAttributes.parse_obj({ + _obj = cls.model_validate({ "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), "id": obj.get("id"), @@ -82,3 +102,4 @@ def from_dict(cls, obj: dict) -> UserlessResourceAttributes: }) return _obj + diff --git a/neurostore_sdk/models/writeable_resource_attributes.py b/neurostore_sdk/models/writeable_resource_attributes.py deleted file mode 100644 index 5aeb1d7..0000000 --- a/neurostore_sdk/models/writeable_resource_attributes.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding: utf-8 - -""" - neurostore api - - Create studysets for meta-analysis # noqa: E501 - - The version of the OpenAPI document: 1.0 - Contact: jamesdkent21@gmail.com - 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, Field, StrictBool, constr - -class WriteableResourceAttributes(BaseModel): - """ - common resource attributes - """ - id: Optional[constr(strict=True, max_length=30, 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 = ["id", "public"] - - 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) -> WriteableResourceAttributes: - """Create an instance of WriteableResourceAttributes 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) - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> WriteableResourceAttributes: - """Create an instance of WriteableResourceAttributes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return WriteableResourceAttributes.parse_obj(obj) - - _obj = WriteableResourceAttributes.parse_obj({ - "id": obj.get("id"), - "public": obj.get("public") if obj.get("public") is not None else True - }) - return _obj - diff --git a/neurostore_sdk/py.typed b/neurostore_sdk/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/neurostore_sdk/rest.py b/neurostore_sdk/rest.py index 214be8f..589fa91 100644 --- a/neurostore_sdk/rest.py +++ b/neurostore_sdk/rest.py @@ -3,55 +3,67 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 import io import json -import logging import re import ssl -from urllib.parse import urlencode, quote_plus import urllib3 -from neurostore_sdk.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from neurostore_sdk.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -60,74 +72,79 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -136,63 +153,86 @@ def request(self, method, url, query_params=None, headers=None, post_params = post_params or {} headers = headers or {} - # url already contains the URL query string - # so reset query_params to empty dict - query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int,float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: # no content type provided or payload is json - if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE): + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -203,99 +243,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields={}, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def get_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def head_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def options_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def delete_request(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def post_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def put_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def patch_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return RESTResponse(r) diff --git a/pyproject.toml b/pyproject.toml index 429a614..098fc50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,19 +7,24 @@ license = "NoLicense" readme = "README.md" repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" keywords = ["OpenAPI", "OpenAPI-Generator", "neurostore api"] +include = ["neurostore_sdk/py.typed"] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" -urllib3 = ">= 1.25.3" -python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" -aenum = ">=3.1.11" +urllib3 = ">= 1.25.3, < 3.0.0" +python-dateutil = ">= 2.8.2" +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" [tool.poetry.dev-dependencies] -pytest = ">=7.2.1" -tox = ">=3.9.0" -flake8 = ">=4.0.0" +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + [build-system] requires = ["setuptools"] @@ -27,3 +32,58 @@ build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "neurostore_sdk", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "neurostore_sdk.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 74ede17..67f7f68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3 -pydantic >= 1.10.5, < 2 -aenum >= 3.1.11 +urllib3 >= 1.25.3, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.py b/setup.py index 505f3cc..edae183 100644 --- a/setup.py +++ b/setup.py @@ -3,14 +3,14 @@ """ neurostore api - Create studysets for meta-analysis # noqa: E501 + Create studysets for meta-analysis The version of the OpenAPI document: 1.0 Contact: jamesdkent21@gmail.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" +""" # noqa: E501 from setuptools import setup, find_packages # noqa: H301 @@ -23,12 +23,12 @@ # http://pypi.python.org/pypi/setuptools NAME = "neurostore-sdk" VERSION = "0.0.1" -PYTHON_REQUIRES = ">=3.7" +PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", - "pydantic >= 1.10.5, < 2", - "aenum" + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] setup( @@ -44,6 +44,7 @@ include_package_data=True, long_description_content_type='text/markdown', long_description="""\ - Create studysets for meta-analysis # noqa: E501 - """ -) + Create studysets for meta-analysis + """, # noqa: E501 + package_data={"neurostore_sdk": ["py.typed"]}, +) \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 3a0d0b9..e98555c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,6 @@ -pytest~=7.1.3 -pytest-cov>=2.8.1 -pytest-randomly>=3.12.0 +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_analyses_api.py b/test/test_analyses_api.py new file mode 100644 index 0000000..06267de --- /dev/null +++ b/test/test_analyses_api.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.analyses_api import AnalysesApi + + +class TestAnalysesApi(unittest.TestCase): + """AnalysesApi unit test stubs""" + + def setUp(self) -> None: + self.api = AnalysesApi() + + def tearDown(self) -> None: + pass + + def test_analyses_get(self) -> None: + """Test case for analyses_get + + GET list of analyses + """ + pass + + def test_analyses_id_delete(self) -> None: + """Test case for analyses_id_delete + + DELETE an analysis + """ + pass + + def test_analyses_id_get(self) -> None: + """Test case for analyses_id_get + + GET an analysis + """ + pass + + def test_analyses_id_put(self) -> None: + """Test case for analyses_id_put + + PUT/update an analysis + """ + pass + + def test_analyses_post(self) -> None: + """Test case for analyses_post + + POST/create an analysis + """ + pass + + def test_annotation_analyses_get(self) -> None: + """Test case for annotation_analyses_get + + Get annotation analyses + """ + pass + + def test_annotation_analyses_id_get(self) -> None: + """Test case for annotation_analyses_id_get + + Your GET endpoint + """ + pass + + def test_annotation_analyses_id_put(self) -> None: + """Test case for annotation_analyses_id_put + + Your PUT endpoint + """ + pass + + def test_annotation_analyses_post(self) -> None: + """Test case for annotation_analyses_post + + Your POST endpoint + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_base.py b/test/test_analysis_base.py new file mode 100644 index 0000000..83995d2 --- /dev/null +++ b/test/test_analysis_base.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_base import AnalysisBase + +class TestAnalysisBase(unittest.TestCase): + """AnalysisBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisBase: + """Test AnalysisBase + 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 `AnalysisBase` + """ + model = AnalysisBase() + if include_optional: + return AnalysisBase( + name = '"houses>faces"', + description = 'This analysis represents a contrast of houses versus faces.', + weights = [ + 1 + ] + ) + else: + return AnalysisBase( + ) + """ + + def testAnalysisBase(self): + """Test AnalysisBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_common.py b/test/test_analysis_common.py new file mode 100644 index 0000000..6cd193d --- /dev/null +++ b/test/test_analysis_common.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_common import AnalysisCommon + +class TestAnalysisCommon(unittest.TestCase): + """AnalysisCommon unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisCommon: + """Test AnalysisCommon + 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 `AnalysisCommon` + """ + model = AnalysisCommon() + if include_optional: + return AnalysisCommon( + study = '', + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + order = 56 + ) + else: + return AnalysisCommon( + ) + """ + + def testAnalysisCommon(self): + """Test AnalysisCommon""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_list.py b/test/test_analysis_list.py new file mode 100644 index 0000000..d114197 --- /dev/null +++ b/test/test_analysis_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_list import AnalysisList + +class TestAnalysisList(unittest.TestCase): + """AnalysisList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisList: + """Test AnalysisList + 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 `AnalysisList` + """ + model = AnalysisList() + if include_optional: + return AnalysisList( + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ), + results = [ + null + ] + ) + else: + return AnalysisList( + ) + """ + + def testAnalysisList(self): + """Test AnalysisList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_request.py b/test/test_analysis_request.py new file mode 100644 index 0000000..e07bbfc --- /dev/null +++ b/test/test_analysis_request.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_request import AnalysisRequest + +class TestAnalysisRequest(unittest.TestCase): + """AnalysisRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisRequest: + """Test AnalysisRequest + 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 `AnalysisRequest` + """ + model = AnalysisRequest() + if include_optional: + return AnalysisRequest( + name = '"houses>faces"', + description = 'This analysis represents a contrast of houses versus faces.', + weights = [ + 1 + ], + study = '', + images = None, + points = None, + conditions = None, + id = '38jobTomPDqt', + public = True, + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + order = 56 + ) + else: + return AnalysisRequest( + ) + """ + + def testAnalysisRequest(self): + """Test AnalysisRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_request_relationships.py b/test/test_analysis_request_relationships.py new file mode 100644 index 0000000..b519f16 --- /dev/null +++ b/test/test_analysis_request_relationships.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_request_relationships import AnalysisRequestRelationships + +class TestAnalysisRequestRelationships(unittest.TestCase): + """AnalysisRequestRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisRequestRelationships: + """Test AnalysisRequestRelationships + 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 `AnalysisRequestRelationships` + """ + model = AnalysisRequestRelationships() + if include_optional: + return AnalysisRequestRelationships( + study = '', + images = None, + points = None, + conditions = None + ) + else: + return AnalysisRequestRelationships( + ) + """ + + def testAnalysisRequestRelationships(self): + """Test AnalysisRequestRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_request_relationships_conditions.py b/test/test_analysis_request_relationships_conditions.py new file mode 100644 index 0000000..9338e8a --- /dev/null +++ b/test/test_analysis_request_relationships_conditions.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_request_relationships_conditions import AnalysisRequestRelationshipsConditions + +class TestAnalysisRequestRelationshipsConditions(unittest.TestCase): + """AnalysisRequestRelationshipsConditions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisRequestRelationshipsConditions: + """Test AnalysisRequestRelationshipsConditions + 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 `AnalysisRequestRelationshipsConditions` + """ + model = AnalysisRequestRelationshipsConditions() + if include_optional: + return AnalysisRequestRelationshipsConditions( + ) + else: + return AnalysisRequestRelationshipsConditions( + ) + """ + + def testAnalysisRequestRelationshipsConditions(self): + """Test AnalysisRequestRelationshipsConditions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_request_relationships_images.py b/test/test_analysis_request_relationships_images.py new file mode 100644 index 0000000..b19409a --- /dev/null +++ b/test/test_analysis_request_relationships_images.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_request_relationships_images import AnalysisRequestRelationshipsImages + +class TestAnalysisRequestRelationshipsImages(unittest.TestCase): + """AnalysisRequestRelationshipsImages unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisRequestRelationshipsImages: + """Test AnalysisRequestRelationshipsImages + 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 `AnalysisRequestRelationshipsImages` + """ + model = AnalysisRequestRelationshipsImages() + if include_optional: + return AnalysisRequestRelationshipsImages( + ) + else: + return AnalysisRequestRelationshipsImages( + ) + """ + + def testAnalysisRequestRelationshipsImages(self): + """Test AnalysisRequestRelationshipsImages""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_request_relationships_points.py b/test/test_analysis_request_relationships_points.py new file mode 100644 index 0000000..91ef0cd --- /dev/null +++ b/test/test_analysis_request_relationships_points.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_request_relationships_points import AnalysisRequestRelationshipsPoints + +class TestAnalysisRequestRelationshipsPoints(unittest.TestCase): + """AnalysisRequestRelationshipsPoints unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisRequestRelationshipsPoints: + """Test AnalysisRequestRelationshipsPoints + 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 `AnalysisRequestRelationshipsPoints` + """ + model = AnalysisRequestRelationshipsPoints() + if include_optional: + return AnalysisRequestRelationshipsPoints( + ) + else: + return AnalysisRequestRelationshipsPoints( + ) + """ + + def testAnalysisRequestRelationshipsPoints(self): + """Test AnalysisRequestRelationshipsPoints""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_return.py b/test/test_analysis_return.py new file mode 100644 index 0000000..b27ba88 --- /dev/null +++ b/test/test_analysis_return.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_return import AnalysisReturn + +class TestAnalysisReturn(unittest.TestCase): + """AnalysisReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisReturn: + """Test AnalysisReturn + 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 `AnalysisReturn` + """ + model = AnalysisReturn() + if include_optional: + return AnalysisReturn( + name = '"houses>faces"', + description = 'This analysis represents a contrast of houses versus faces.', + weights = [ + 1 + ], + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '', + study = '', + images = None, + points = None, + conditions = None, + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + order = 56 + ) + else: + return AnalysisReturn( + ) + """ + + def testAnalysisReturn(self): + """Test AnalysisReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_return_relationships.py b/test/test_analysis_return_relationships.py new file mode 100644 index 0000000..39f0f9b --- /dev/null +++ b/test/test_analysis_return_relationships.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_return_relationships import AnalysisReturnRelationships + +class TestAnalysisReturnRelationships(unittest.TestCase): + """AnalysisReturnRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisReturnRelationships: + """Test AnalysisReturnRelationships + 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 `AnalysisReturnRelationships` + """ + model = AnalysisReturnRelationships() + if include_optional: + return AnalysisReturnRelationships( + study = '', + images = None, + points = None, + conditions = None + ) + else: + return AnalysisReturnRelationships( + ) + """ + + def testAnalysisReturnRelationships(self): + """Test AnalysisReturnRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_return_relationships_conditions.py b/test/test_analysis_return_relationships_conditions.py new file mode 100644 index 0000000..e4bfced --- /dev/null +++ b/test/test_analysis_return_relationships_conditions.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_return_relationships_conditions import AnalysisReturnRelationshipsConditions + +class TestAnalysisReturnRelationshipsConditions(unittest.TestCase): + """AnalysisReturnRelationshipsConditions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisReturnRelationshipsConditions: + """Test AnalysisReturnRelationshipsConditions + 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 `AnalysisReturnRelationshipsConditions` + """ + model = AnalysisReturnRelationshipsConditions() + if include_optional: + return AnalysisReturnRelationshipsConditions( + ) + else: + return AnalysisReturnRelationshipsConditions( + ) + """ + + def testAnalysisReturnRelationshipsConditions(self): + """Test AnalysisReturnRelationshipsConditions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_return_relationships_images.py b/test/test_analysis_return_relationships_images.py new file mode 100644 index 0000000..c0488e5 --- /dev/null +++ b/test/test_analysis_return_relationships_images.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_return_relationships_images import AnalysisReturnRelationshipsImages + +class TestAnalysisReturnRelationshipsImages(unittest.TestCase): + """AnalysisReturnRelationshipsImages unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisReturnRelationshipsImages: + """Test AnalysisReturnRelationshipsImages + 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 `AnalysisReturnRelationshipsImages` + """ + model = AnalysisReturnRelationshipsImages() + if include_optional: + return AnalysisReturnRelationshipsImages( + ) + else: + return AnalysisReturnRelationshipsImages( + ) + """ + + def testAnalysisReturnRelationshipsImages(self): + """Test AnalysisReturnRelationshipsImages""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_analysis_return_relationships_points.py b/test/test_analysis_return_relationships_points.py new file mode 100644 index 0000000..fa3e0b4 --- /dev/null +++ b/test/test_analysis_return_relationships_points.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.analysis_return_relationships_points import AnalysisReturnRelationshipsPoints + +class TestAnalysisReturnRelationshipsPoints(unittest.TestCase): + """AnalysisReturnRelationshipsPoints unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalysisReturnRelationshipsPoints: + """Test AnalysisReturnRelationshipsPoints + 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 `AnalysisReturnRelationshipsPoints` + """ + model = AnalysisReturnRelationshipsPoints() + if include_optional: + return AnalysisReturnRelationshipsPoints( + ) + else: + return AnalysisReturnRelationshipsPoints( + ) + """ + + def testAnalysisReturnRelationshipsPoints(self): + """Test AnalysisReturnRelationshipsPoints""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_base.py b/test/test_annotation_base.py new file mode 100644 index 0000000..412fe49 --- /dev/null +++ b/test/test_annotation_base.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_base import AnnotationBase + +class TestAnnotationBase(unittest.TestCase): + """AnnotationBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationBase: + """Test AnnotationBase + 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 `AnnotationBase` + """ + model = AnnotationBase() + if include_optional: + return AnnotationBase( + name = 'Examination of left versus right finger tapping', + description = 'This annotation tracks whether the analysis of interest for all included studies are left handed/right handed, or bimanual taps.', + metadata = None, + note_keys = {include=boolean} + ) + else: + return AnnotationBase( + ) + """ + + def testAnnotationBase(self): + """Test AnnotationBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_common.py b/test/test_annotation_common.py new file mode 100644 index 0000000..41d5df3 --- /dev/null +++ b/test/test_annotation_common.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_common import AnnotationCommon + +class TestAnnotationCommon(unittest.TestCase): + """AnnotationCommon unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationCommon: + """Test AnnotationCommon + 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 `AnnotationCommon` + """ + model = AnnotationCommon() + if include_optional: + return AnnotationCommon( + studyset = '' + ) + else: + return AnnotationCommon( + ) + """ + + def testAnnotationCommon(self): + """Test AnnotationCommon""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_export.py b/test/test_annotation_export.py new file mode 100644 index 0000000..003858e --- /dev/null +++ b/test/test_annotation_export.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_export import AnnotationExport + +class TestAnnotationExport(unittest.TestCase): + """AnnotationExport unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationExport: + """Test AnnotationExport + 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 `AnnotationExport` + """ + model = AnnotationExport() + if include_optional: + return AnnotationExport( + metadata = None, + annotation_csv = '' + ) + else: + return AnnotationExport( + annotation_csv = '', + ) + """ + + def testAnnotationExport(self): + """Test AnnotationExport""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_list.py b/test/test_annotation_list.py new file mode 100644 index 0000000..8e54378 --- /dev/null +++ b/test/test_annotation_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_list import AnnotationList + +class TestAnnotationList(unittest.TestCase): + """AnnotationList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationList: + """Test AnnotationList + 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 `AnnotationList` + """ + model = AnnotationList() + if include_optional: + return AnnotationList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return AnnotationList( + ) + """ + + def testAnnotationList(self): + """Test AnnotationList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_request.py b/test/test_annotation_request.py new file mode 100644 index 0000000..b86b87b --- /dev/null +++ b/test/test_annotation_request.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_request import AnnotationRequest + +class TestAnnotationRequest(unittest.TestCase): + """AnnotationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationRequest: + """Test AnnotationRequest + 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 `AnnotationRequest` + """ + model = AnnotationRequest() + if include_optional: + return AnnotationRequest( + metadata = None, + annotation_csv = '', + name = 'Examination of left versus right finger tapping', + description = 'This annotation tracks whether the analysis of interest for all included studies are left handed/right handed, or bimanual taps.', + note_keys = {include=boolean}, + notes = None, + id = '38jobTomPDqt', + public = True, + studyset = '' + ) + else: + return AnnotationRequest( + annotation_csv = '', + ) + """ + + def testAnnotationRequest(self): + """Test AnnotationRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_request_one_of.py b/test/test_annotation_request_one_of.py new file mode 100644 index 0000000..a7a95d8 --- /dev/null +++ b/test/test_annotation_request_one_of.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_request_one_of import AnnotationRequestOneOf + +class TestAnnotationRequestOneOf(unittest.TestCase): + """AnnotationRequestOneOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationRequestOneOf: + """Test AnnotationRequestOneOf + 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 `AnnotationRequestOneOf` + """ + model = AnnotationRequestOneOf() + if include_optional: + return AnnotationRequestOneOf( + name = 'Examination of left versus right finger tapping', + description = 'This annotation tracks whether the analysis of interest for all included studies are left handed/right handed, or bimanual taps.', + metadata = neurostore_sdk.models.metadata.metadata(), + note_keys = {include=boolean}, + notes = None, + id = '38jobTomPDqt', + public = True, + studyset = '' + ) + else: + return AnnotationRequestOneOf( + ) + """ + + def testAnnotationRequestOneOf(self): + """Test AnnotationRequestOneOf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_request_relationships.py b/test/test_annotation_request_relationships.py new file mode 100644 index 0000000..6665bb4 --- /dev/null +++ b/test/test_annotation_request_relationships.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_request_relationships import AnnotationRequestRelationships + +class TestAnnotationRequestRelationships(unittest.TestCase): + """AnnotationRequestRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationRequestRelationships: + """Test AnnotationRequestRelationships + 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 `AnnotationRequestRelationships` + """ + model = AnnotationRequestRelationships() + if include_optional: + return AnnotationRequestRelationships( + notes = None + ) + else: + return AnnotationRequestRelationships( + ) + """ + + def testAnnotationRequestRelationships(self): + """Test AnnotationRequestRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_request_relationships_notes.py b/test/test_annotation_request_relationships_notes.py new file mode 100644 index 0000000..b521ee0 --- /dev/null +++ b/test/test_annotation_request_relationships_notes.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_request_relationships_notes import AnnotationRequestRelationshipsNotes + +class TestAnnotationRequestRelationshipsNotes(unittest.TestCase): + """AnnotationRequestRelationshipsNotes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationRequestRelationshipsNotes: + """Test AnnotationRequestRelationshipsNotes + 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 `AnnotationRequestRelationshipsNotes` + """ + model = AnnotationRequestRelationshipsNotes() + if include_optional: + return AnnotationRequestRelationshipsNotes( + ) + else: + return AnnotationRequestRelationshipsNotes( + ) + """ + + def testAnnotationRequestRelationshipsNotes(self): + """Test AnnotationRequestRelationshipsNotes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_return.py b/test/test_annotation_return.py new file mode 100644 index 0000000..f1b50fb --- /dev/null +++ b/test/test_annotation_return.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_return import AnnotationReturn + +class TestAnnotationReturn(unittest.TestCase): + """AnnotationReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationReturn: + """Test AnnotationReturn + 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 `AnnotationReturn` + """ + model = AnnotationReturn() + if include_optional: + return AnnotationReturn( + metadata = None, + annotation_csv = '', + name = 'Examination of left versus right finger tapping', + description = 'This annotation tracks whether the analysis of interest for all included studies are left handed/right handed, or bimanual taps.', + note_keys = {include=boolean}, + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '', + source = '', + source_id = '', + source_updated_at = '', + notes = None, + studyset = '' + ) + else: + return AnnotationReturn( + annotation_csv = '', + ) + """ + + def testAnnotationReturn(self): + """Test AnnotationReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_return_one_of.py b/test/test_annotation_return_one_of.py new file mode 100644 index 0000000..0749ccf --- /dev/null +++ b/test/test_annotation_return_one_of.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_return_one_of import AnnotationReturnOneOf + +class TestAnnotationReturnOneOf(unittest.TestCase): + """AnnotationReturnOneOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationReturnOneOf: + """Test AnnotationReturnOneOf + 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 `AnnotationReturnOneOf` + """ + model = AnnotationReturnOneOf() + if include_optional: + return AnnotationReturnOneOf( + metadata = neurostore_sdk.models.metadata.metadata(), + annotation_csv = '' + ) + else: + return AnnotationReturnOneOf( + annotation_csv = '', + ) + """ + + def testAnnotationReturnOneOf(self): + """Test AnnotationReturnOneOf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_return_one_of1.py b/test/test_annotation_return_one_of1.py new file mode 100644 index 0000000..3382917 --- /dev/null +++ b/test/test_annotation_return_one_of1.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_return_one_of1 import AnnotationReturnOneOf1 + +class TestAnnotationReturnOneOf1(unittest.TestCase): + """AnnotationReturnOneOf1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationReturnOneOf1: + """Test AnnotationReturnOneOf1 + 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 `AnnotationReturnOneOf1` + """ + model = AnnotationReturnOneOf1() + if include_optional: + return AnnotationReturnOneOf1( + name = 'Examination of left versus right finger tapping', + description = 'This annotation tracks whether the analysis of interest for all included studies are left handed/right handed, or bimanual taps.', + metadata = neurostore_sdk.models.metadata.metadata(), + note_keys = {include=boolean}, + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '', + source = '', + source_id = '', + source_updated_at = '', + notes = None, + studyset = '' + ) + else: + return AnnotationReturnOneOf1( + ) + """ + + def testAnnotationReturnOneOf1(self): + """Test AnnotationReturnOneOf1""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_return_relationships.py b/test/test_annotation_return_relationships.py new file mode 100644 index 0000000..a2dba87 --- /dev/null +++ b/test/test_annotation_return_relationships.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_return_relationships import AnnotationReturnRelationships + +class TestAnnotationReturnRelationships(unittest.TestCase): + """AnnotationReturnRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationReturnRelationships: + """Test AnnotationReturnRelationships + 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 `AnnotationReturnRelationships` + """ + model = AnnotationReturnRelationships() + if include_optional: + return AnnotationReturnRelationships( + notes = None + ) + else: + return AnnotationReturnRelationships( + ) + """ + + def testAnnotationReturnRelationships(self): + """Test AnnotationReturnRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotation_return_relationships_notes.py b/test/test_annotation_return_relationships_notes.py new file mode 100644 index 0000000..141bf71 --- /dev/null +++ b/test/test_annotation_return_relationships_notes.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.annotation_return_relationships_notes import AnnotationReturnRelationshipsNotes + +class TestAnnotationReturnRelationshipsNotes(unittest.TestCase): + """AnnotationReturnRelationshipsNotes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotationReturnRelationshipsNotes: + """Test AnnotationReturnRelationshipsNotes + 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 `AnnotationReturnRelationshipsNotes` + """ + model = AnnotationReturnRelationshipsNotes() + if include_optional: + return AnnotationReturnRelationshipsNotes( + ) + else: + return AnnotationReturnRelationshipsNotes( + ) + """ + + def testAnnotationReturnRelationshipsNotes(self): + """Test AnnotationReturnRelationshipsNotes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_annotations_api.py b/test/test_annotations_api.py new file mode 100644 index 0000000..5f16934 --- /dev/null +++ b/test/test_annotations_api.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.annotations_api import AnnotationsApi + + +class TestAnnotationsApi(unittest.TestCase): + """AnnotationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = AnnotationsApi() + + def tearDown(self) -> None: + pass + + def test_annotation_analyses_get(self) -> None: + """Test case for annotation_analyses_get + + Get annotation analyses + """ + pass + + def test_annotation_analyses_id_get(self) -> None: + """Test case for annotation_analyses_id_get + + Your GET endpoint + """ + pass + + def test_annotation_analyses_id_put(self) -> None: + """Test case for annotation_analyses_id_put + + Your PUT endpoint + """ + pass + + def test_annotation_analyses_post(self) -> None: + """Test case for annotation_analyses_post + + Your POST endpoint + """ + pass + + def test_annotations_get(self) -> None: + """Test case for annotations_get + + Your GET endpoint + """ + pass + + def test_annotations_id_delete(self) -> None: + """Test case for annotations_id_delete + + DELETE an annotation + """ + pass + + def test_annotations_id_get(self) -> None: + """Test case for annotations_id_get + + Your GET endpoint + """ + pass + + def test_annotations_id_put(self) -> None: + """Test case for annotations_id_put + + Update an annotation + """ + pass + + def test_annotations_post(self) -> None: + """Test case for annotations_post + + Post Annotation + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_studies_post200_response.py b/test/test_base_studies_post200_response.py new file mode 100644 index 0000000..467cffc --- /dev/null +++ b/test/test_base_studies_post200_response.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.base_studies_post200_response import BaseStudiesPost200Response + +class TestBaseStudiesPost200Response(unittest.TestCase): + """BaseStudiesPost200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseStudiesPost200Response: + """Test BaseStudiesPost200Response + 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 `BaseStudiesPost200Response` + """ + model = BaseStudiesPost200Response() + if include_optional: + return BaseStudiesPost200Response( + metadata = neurostore_sdk.models.metadata.metadata(), + versions = None, + name = '', + description = '', + publication = '', + doi = '', + pmid = '', + authors = '', + year = 56, + level = '', + pmcid = '', + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '' + ) + else: + return BaseStudiesPost200Response( + ) + """ + + def testBaseStudiesPost200Response(self): + """Test BaseStudiesPost200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_studies_post_request.py b/test/test_base_studies_post_request.py new file mode 100644 index 0000000..84189e9 --- /dev/null +++ b/test/test_base_studies_post_request.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.base_studies_post_request import BaseStudiesPostRequest + +class TestBaseStudiesPostRequest(unittest.TestCase): + """BaseStudiesPostRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseStudiesPostRequest: + """Test BaseStudiesPostRequest + 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 `BaseStudiesPostRequest` + """ + model = BaseStudiesPostRequest() + if include_optional: + return BaseStudiesPostRequest( + metadata = neurostore_sdk.models.metadata.metadata(), + versions = None, + name = '', + description = '', + publication = '', + doi = '', + pmid = '', + authors = '', + year = 56, + level = '', + pmcid = '' + ) + else: + return BaseStudiesPostRequest( + ) + """ + + def testBaseStudiesPostRequest(self): + """Test BaseStudiesPostRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_study.py b/test/test_base_study.py new file mode 100644 index 0000000..5ee2873 --- /dev/null +++ b/test/test_base_study.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.base_study import BaseStudy + +class TestBaseStudy(unittest.TestCase): + """BaseStudy unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseStudy: + """Test BaseStudy + 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 `BaseStudy` + """ + model = BaseStudy() + if include_optional: + return BaseStudy( + metadata = None, + versions = None, + name = '', + description = '', + publication = '', + doi = '', + pmid = '', + authors = '', + year = 56, + level = '', + pmcid = '' + ) + else: + return BaseStudy( + ) + """ + + def testBaseStudy(self): + """Test BaseStudy""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_study_list.py b/test/test_base_study_list.py new file mode 100644 index 0000000..7e27b14 --- /dev/null +++ b/test/test_base_study_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.base_study_list import BaseStudyList + +class TestBaseStudyList(unittest.TestCase): + """BaseStudyList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseStudyList: + """Test BaseStudyList + 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 `BaseStudyList` + """ + model = BaseStudyList() + if include_optional: + return BaseStudyList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return BaseStudyList( + ) + """ + + def testBaseStudyList(self): + """Test BaseStudyList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_study_return.py b/test/test_base_study_return.py new file mode 100644 index 0000000..3ed5cb2 --- /dev/null +++ b/test/test_base_study_return.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.base_study_return import BaseStudyReturn + +class TestBaseStudyReturn(unittest.TestCase): + """BaseStudyReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseStudyReturn: + """Test BaseStudyReturn + 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 `BaseStudyReturn` + """ + model = BaseStudyReturn() + if include_optional: + return BaseStudyReturn( + metadata = neurostore_sdk.models.metadata.metadata(), + versions = None, + name = '', + description = '', + publication = '', + doi = '', + pmid = '', + authors = '', + year = 56, + level = '', + pmcid = '', + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '' + ) + else: + return BaseStudyReturn( + ) + """ + + def testBaseStudyReturn(self): + """Test BaseStudyReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_base_study_versions.py b/test/test_base_study_versions.py new file mode 100644 index 0000000..c2a43d0 --- /dev/null +++ b/test/test_base_study_versions.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.base_study_versions import BaseStudyVersions + +class TestBaseStudyVersions(unittest.TestCase): + """BaseStudyVersions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseStudyVersions: + """Test BaseStudyVersions + 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 `BaseStudyVersions` + """ + model = BaseStudyVersions() + if include_optional: + return BaseStudyVersions( + ) + else: + return BaseStudyVersions( + ) + """ + + def testBaseStudyVersions(self): + """Test BaseStudyVersions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_clone.py b/test/test_clone.py new file mode 100644 index 0000000..e276a2a --- /dev/null +++ b/test/test_clone.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.clone import Clone + +class TestClone(unittest.TestCase): + """Clone unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Clone: + """Test Clone + 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 `Clone` + """ + model = Clone() + if include_optional: + return Clone( + source = '', + source_id = '', + source_updated_at = '' + ) + else: + return Clone( + ) + """ + + def testClone(self): + """Test Clone""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_condition_base.py b/test/test_condition_base.py new file mode 100644 index 0000000..14d4c94 --- /dev/null +++ b/test/test_condition_base.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.condition_base import ConditionBase + +class TestConditionBase(unittest.TestCase): + """ConditionBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConditionBase: + """Test ConditionBase + 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 `ConditionBase` + """ + model = ConditionBase() + if include_optional: + return ConditionBase( + name = '1-back', + description = 'the 1-back represents the condition where the the previous stimulus is compared the the current stimulus ' + ) + else: + return ConditionBase( + ) + """ + + def testConditionBase(self): + """Test ConditionBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_condition_list.py b/test/test_condition_list.py new file mode 100644 index 0000000..3df4d8b --- /dev/null +++ b/test/test_condition_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.condition_list import ConditionList + +class TestConditionList(unittest.TestCase): + """ConditionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConditionList: + """Test ConditionList + 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 `ConditionList` + """ + model = ConditionList() + if include_optional: + return ConditionList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return ConditionList( + ) + """ + + def testConditionList(self): + """Test ConditionList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_condition_request.py b/test/test_condition_request.py new file mode 100644 index 0000000..48cbebf --- /dev/null +++ b/test/test_condition_request.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.condition_request import ConditionRequest + +class TestConditionRequest(unittest.TestCase): + """ConditionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConditionRequest: + """Test ConditionRequest + 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 `ConditionRequest` + """ + model = ConditionRequest() + if include_optional: + return ConditionRequest( + name = '1-back', + description = 'the 1-back represents the condition where the the previous stimulus is compared the the current stimulus ', + id = '38jobTomPDqt', + public = True + ) + else: + return ConditionRequest( + ) + """ + + def testConditionRequest(self): + """Test ConditionRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_condition_return.py b/test/test_condition_return.py new file mode 100644 index 0000000..4366458 --- /dev/null +++ b/test/test_condition_return.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.condition_return import ConditionReturn + +class TestConditionReturn(unittest.TestCase): + """ConditionReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ConditionReturn: + """Test ConditionReturn + 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 `ConditionReturn` + """ + model = ConditionReturn() + if include_optional: + return ConditionReturn( + name = '1-back', + description = 'the 1-back represents the condition where the the previous stimulus is compared the the current stimulus ', + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '' + ) + else: + return ConditionReturn( + ) + """ + + def testConditionReturn(self): + """Test ConditionReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_conditions_api.py b/test/test_conditions_api.py new file mode 100644 index 0000000..ed22f80 --- /dev/null +++ b/test/test_conditions_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.conditions_api import ConditionsApi + + +class TestConditionsApi(unittest.TestCase): + """ConditionsApi unit test stubs""" + + def setUp(self) -> None: + self.api = ConditionsApi() + + def tearDown(self) -> None: + pass + + def test_conditions_get(self) -> None: + """Test case for conditions_get + + GET Conditions + """ + pass + + def test_conditions_id_delete(self) -> None: + """Test case for conditions_id_delete + + DELETE a condition + """ + pass + + def test_conditions_id_get(self) -> None: + """Test case for conditions_id_get + + GET a condition + """ + pass + + def test_conditions_id_put(self) -> None: + """Test case for conditions_id_put + + PUT/update a condition + """ + pass + + def test_conditions_post(self) -> None: + """Test case for conditions_post + + POST/Create a condition + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_entity.py b/test/test_entity.py new file mode 100644 index 0000000..71e0939 --- /dev/null +++ b/test/test_entity.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.entity import Entity + +class TestEntity(unittest.TestCase): + """Entity unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Entity: + """Test Entity + 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 `Entity` + """ + model = Entity() + if include_optional: + return Entity( + label = '', + level = '', + analysis = '' + ) + else: + return Entity( + ) + """ + + def testEntity(self): + """Test Entity""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_base.py b/test/test_image_base.py new file mode 100644 index 0000000..1957403 --- /dev/null +++ b/test/test_image_base.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.image_base import ImageBase + +class TestImageBase(unittest.TestCase): + """ImageBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageBase: + """Test ImageBase + 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 `ImageBase` + """ + model = ImageBase() + if include_optional: + return ImageBase( + metadata = neurostore_sdk.models.metadata.metadata(), + url = 'https://neurovault.org/media/images/4778/Positive_RPEs_zstat.nii.gz', + filename = 'Positive_RPEs_zstat.nii.gz', + space = 'MNI152NLin2009aAsym', + value_type = 'Z', + add_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return ImageBase( + ) + """ + + def testImageBase(self): + """Test ImageBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_common.py b/test/test_image_common.py new file mode 100644 index 0000000..393d5ae --- /dev/null +++ b/test/test_image_common.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.image_common import ImageCommon + +class TestImageCommon(unittest.TestCase): + """ImageCommon unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageCommon: + """Test ImageCommon + 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 `ImageCommon` + """ + model = ImageCommon() + if include_optional: + return ImageCommon( + analysis = '' + ) + else: + return ImageCommon( + ) + """ + + def testImageCommon(self): + """Test ImageCommon""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_list.py b/test/test_image_list.py new file mode 100644 index 0000000..f87c2af --- /dev/null +++ b/test/test_image_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.image_list import ImageList + +class TestImageList(unittest.TestCase): + """ImageList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageList: + """Test ImageList + 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 `ImageList` + """ + model = ImageList() + if include_optional: + return ImageList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return ImageList( + ) + """ + + def testImageList(self): + """Test ImageList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_relationships.py b/test/test_image_relationships.py new file mode 100644 index 0000000..9d7b9bf --- /dev/null +++ b/test/test_image_relationships.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.image_relationships import ImageRelationships + +class TestImageRelationships(unittest.TestCase): + """ImageRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageRelationships: + """Test ImageRelationships + 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 `ImageRelationships` + """ + model = ImageRelationships() + if include_optional: + return ImageRelationships( + analysis = '', + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + analysis_name = '' + ) + else: + return ImageRelationships( + ) + """ + + def testImageRelationships(self): + """Test ImageRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_request.py b/test/test_image_request.py new file mode 100644 index 0000000..4cb9e31 --- /dev/null +++ b/test/test_image_request.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.image_request import ImageRequest + +class TestImageRequest(unittest.TestCase): + """ImageRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageRequest: + """Test ImageRequest + 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 `ImageRequest` + """ + model = ImageRequest() + if include_optional: + return ImageRequest( + metadata = neurostore_sdk.models.metadata.metadata(), + url = 'https://neurovault.org/media/images/4778/Positive_RPEs_zstat.nii.gz', + filename = 'Positive_RPEs_zstat.nii.gz', + space = 'MNI152NLin2009aAsym', + value_type = 'Z', + add_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + analysis = '', + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + analysis_name = '', + id = '38jobTomPDqt', + public = True + ) + else: + return ImageRequest( + ) + """ + + def testImageRequest(self): + """Test ImageRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_image_return.py b/test/test_image_return.py new file mode 100644 index 0000000..e06709c --- /dev/null +++ b/test/test_image_return.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.image_return import ImageReturn + +class TestImageReturn(unittest.TestCase): + """ImageReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ImageReturn: + """Test ImageReturn + 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 `ImageReturn` + """ + model = ImageReturn() + if include_optional: + return ImageReturn( + metadata = neurostore_sdk.models.metadata.metadata(), + url = 'https://neurovault.org/media/images/4778/Positive_RPEs_zstat.nii.gz', + filename = 'Positive_RPEs_zstat.nii.gz', + space = 'MNI152NLin2009aAsym', + value_type = 'Z', + add_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + analysis = '', + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + analysis_name = '', + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '' + ) + else: + return ImageReturn( + ) + """ + + def testImageReturn(self): + """Test ImageReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_images_api.py b/test/test_images_api.py new file mode 100644 index 0000000..3f39025 --- /dev/null +++ b/test/test_images_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.images_api import ImagesApi + + +class TestImagesApi(unittest.TestCase): + """ImagesApi unit test stubs""" + + def setUp(self) -> None: + self.api = ImagesApi() + + def tearDown(self) -> None: + pass + + def test_images_get(self) -> None: + """Test case for images_get + + GET a list of images + """ + pass + + def test_images_id_delete(self) -> None: + """Test case for images_id_delete + + DELETE an image + """ + pass + + def test_images_id_get(self) -> None: + """Test case for images_id_get + + GET an image + """ + pass + + def test_images_id_put(self) -> None: + """Test case for images_id_put + + PUT/update an image + """ + pass + + def test_images_post(self) -> None: + """Test case for images_post + + POST/create an image + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_json_ld_context.py b/test/test_json_ld_context.py new file mode 100644 index 0000000..da7f7f3 --- /dev/null +++ b/test/test_json_ld_context.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.json_ld_context import JsonLdContext + +class TestJsonLdContext(unittest.TestCase): + """JsonLdContext unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JsonLdContext: + """Test JsonLdContext + 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 `JsonLdContext` + """ + model = JsonLdContext() + if include_optional: + return JsonLdContext( + vocab = '' + ) + else: + return JsonLdContext( + ) + """ + + def testJsonLdContext(self): + """Test JsonLdContext""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_nested_put_attributes.py b/test/test_nested_put_attributes.py new file mode 100644 index 0000000..53583e3 --- /dev/null +++ b/test/test_nested_put_attributes.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.nested_put_attributes import NestedPutAttributes + +class TestNestedPutAttributes(unittest.TestCase): + """NestedPutAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NestedPutAttributes: + """Test NestedPutAttributes + 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 `NestedPutAttributes` + """ + model = NestedPutAttributes() + if include_optional: + return NestedPutAttributes( + id = '' + ) + else: + return NestedPutAttributes( + ) + """ + + def testNestedPutAttributes(self): + """Test NestedPutAttributes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_note_collection_base.py b/test/test_note_collection_base.py new file mode 100644 index 0000000..3d76a72 --- /dev/null +++ b/test/test_note_collection_base.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.note_collection_base import NoteCollectionBase + +class TestNoteCollectionBase(unittest.TestCase): + """NoteCollectionBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NoteCollectionBase: + """Test NoteCollectionBase + 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 `NoteCollectionBase` + """ + model = NoteCollectionBase() + if include_optional: + return NoteCollectionBase( + note = neurostore_sdk.models.note.note() + ) + else: + return NoteCollectionBase( + ) + """ + + def testNoteCollectionBase(self): + """Test NoteCollectionBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_note_collection_list.py b/test/test_note_collection_list.py new file mode 100644 index 0000000..9c4eb26 --- /dev/null +++ b/test/test_note_collection_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.note_collection_list import NoteCollectionList + +class TestNoteCollectionList(unittest.TestCase): + """NoteCollectionList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NoteCollectionList: + """Test NoteCollectionList + 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 `NoteCollectionList` + """ + model = NoteCollectionList() + if include_optional: + return NoteCollectionList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return NoteCollectionList( + ) + """ + + def testNoteCollectionList(self): + """Test NoteCollectionList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_note_collection_request.py b/test/test_note_collection_request.py new file mode 100644 index 0000000..c511e30 --- /dev/null +++ b/test/test_note_collection_request.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.note_collection_request import NoteCollectionRequest + +class TestNoteCollectionRequest(unittest.TestCase): + """NoteCollectionRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NoteCollectionRequest: + """Test NoteCollectionRequest + 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 `NoteCollectionRequest` + """ + model = NoteCollectionRequest() + if include_optional: + return NoteCollectionRequest( + note = neurostore_sdk.models.note.note(), + id = '38jobTomPDqt', + public = True + ) + else: + return NoteCollectionRequest( + ) + """ + + def testNoteCollectionRequest(self): + """Test NoteCollectionRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_note_collection_return.py b/test/test_note_collection_return.py new file mode 100644 index 0000000..5bee229 --- /dev/null +++ b/test/test_note_collection_return.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.note_collection_return import NoteCollectionReturn + +class TestNoteCollectionReturn(unittest.TestCase): + """NoteCollectionReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NoteCollectionReturn: + """Test NoteCollectionReturn + 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 `NoteCollectionReturn` + """ + model = NoteCollectionReturn() + if include_optional: + return NoteCollectionReturn( + note = neurostore_sdk.models.note.note(), + analysis = '', + analysis_name = '', + study = '', + study_name = '', + annotation = '', + study_year = 56, + publication = '', + authors = '', + id = '' + ) + else: + return NoteCollectionReturn( + ) + """ + + def testNoteCollectionReturn(self): + """Test NoteCollectionReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline.py b/test/test_pipeline.py new file mode 100644 index 0000000..beb3c16 --- /dev/null +++ b/test/test_pipeline.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline import Pipeline + +class TestPipeline(unittest.TestCase): + """Pipeline unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Pipeline: + """Test Pipeline + 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 `Pipeline` + """ + model = Pipeline() + if include_optional: + return Pipeline( + id = '', + name = '', + description = '', + version = '', + study_dependent = True, + ace_compatible = True, + pubget_compatible = True, + derived_from = '' + ) + else: + return Pipeline( + ) + """ + + def testPipeline(self): + """Test Pipeline""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_config.py b/test/test_pipeline_config.py new file mode 100644 index 0000000..e09407d --- /dev/null +++ b/test/test_pipeline_config.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_config import PipelineConfig + +class TestPipelineConfig(unittest.TestCase): + """PipelineConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineConfig: + """Test PipelineConfig + 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 `PipelineConfig` + """ + model = PipelineConfig() + if include_optional: + return PipelineConfig( + id = '', + config = None + ) + else: + return PipelineConfig( + ) + """ + + def testPipelineConfig(self): + """Test PipelineConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_config_list.py b/test/test_pipeline_config_list.py new file mode 100644 index 0000000..0e6fb14 --- /dev/null +++ b/test/test_pipeline_config_list.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_config_list import PipelineConfigList + +class TestPipelineConfigList(unittest.TestCase): + """PipelineConfigList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineConfigList: + """Test PipelineConfigList + 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 `PipelineConfigList` + """ + model = PipelineConfigList() + if include_optional: + return PipelineConfigList( + results = [ + neurostore_sdk.models.pipeline_config.pipeline-config( + id = '', + config = neurostore_sdk.models.config.config(), ) + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return PipelineConfigList( + ) + """ + + def testPipelineConfigList(self): + """Test PipelineConfigList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_configs_api.py b/test/test_pipeline_configs_api.py new file mode 100644 index 0000000..7c392d0 --- /dev/null +++ b/test/test_pipeline_configs_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.pipeline_configs_api import PipelineConfigsApi + + +class TestPipelineConfigsApi(unittest.TestCase): + """PipelineConfigsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PipelineConfigsApi() + + def tearDown(self) -> None: + pass + + def test_pipeline_configs_get(self) -> None: + """Test case for pipeline_configs_get + + GET a list of pipeline configs + """ + pass + + def test_pipeline_configs_id_delete(self) -> None: + """Test case for pipeline_configs_id_delete + + DELETE a pipeline config by ID + """ + pass + + def test_pipeline_configs_id_get(self) -> None: + """Test case for pipeline_configs_id_get + + GET a pipeline config by ID + """ + pass + + def test_pipeline_configs_id_put(self) -> None: + """Test case for pipeline_configs_id_put + + PUT/update a pipeline config by ID + """ + pass + + def test_pipeline_configs_post(self) -> None: + """Test case for pipeline_configs_post + + POST/create a pipeline config + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_list.py b/test/test_pipeline_list.py new file mode 100644 index 0000000..f721b7c --- /dev/null +++ b/test/test_pipeline_list.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_list import PipelineList + +class TestPipelineList(unittest.TestCase): + """PipelineList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineList: + """Test PipelineList + 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 `PipelineList` + """ + model = PipelineList() + if include_optional: + return PipelineList( + results = [ + neurostore_sdk.models.pipeline.pipeline( + id = '', + name = '', + description = '', + version = '', + study_dependent = True, + ace_compatible = True, + pubget_compatible = True, + derived_from = '', ) + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return PipelineList( + ) + """ + + def testPipelineList(self): + """Test PipelineList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run.py b/test/test_pipeline_run.py new file mode 100644 index 0000000..a648ceb --- /dev/null +++ b/test/test_pipeline_run.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_run import PipelineRun + +class TestPipelineRun(unittest.TestCase): + """PipelineRun unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineRun: + """Test PipelineRun + 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 `PipelineRun` + """ + model = PipelineRun() + if include_optional: + return PipelineRun( + id = '', + status = '', + started_at = '', + finished_at = '' + ) + else: + return PipelineRun( + ) + """ + + def testPipelineRun(self): + """Test PipelineRun""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_list.py b/test/test_pipeline_run_list.py new file mode 100644 index 0000000..64a6653 --- /dev/null +++ b/test/test_pipeline_run_list.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_run_list import PipelineRunList + +class TestPipelineRunList(unittest.TestCase): + """PipelineRunList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineRunList: + """Test PipelineRunList + 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 `PipelineRunList` + """ + model = PipelineRunList() + if include_optional: + return PipelineRunList( + results = [ + neurostore_sdk.models.pipeline_run.pipeline-run( + id = '', + status = '', + started_at = '', + finished_at = '', ) + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return PipelineRunList( + ) + """ + + def testPipelineRunList(self): + """Test PipelineRunList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_result.py b/test/test_pipeline_run_result.py new file mode 100644 index 0000000..1ae3220 --- /dev/null +++ b/test/test_pipeline_run_result.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_run_result import PipelineRunResult + +class TestPipelineRunResult(unittest.TestCase): + """PipelineRunResult unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineRunResult: + """Test PipelineRunResult + 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 `PipelineRunResult` + """ + model = PipelineRunResult() + if include_optional: + return PipelineRunResult( + id = '', + pipeline_run_id = '', + data = None + ) + else: + return PipelineRunResult( + ) + """ + + def testPipelineRunResult(self): + """Test PipelineRunResult""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_result_list.py b/test/test_pipeline_run_result_list.py new file mode 100644 index 0000000..63d06ce --- /dev/null +++ b/test/test_pipeline_run_result_list.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_run_result_list import PipelineRunResultList + +class TestPipelineRunResultList(unittest.TestCase): + """PipelineRunResultList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineRunResultList: + """Test PipelineRunResultList + 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 `PipelineRunResultList` + """ + model = PipelineRunResultList() + if include_optional: + return PipelineRunResultList( + results = [ + neurostore_sdk.models.pipeline_run_result.pipeline-run-result( + id = '', + pipeline_run_id = '', + data = neurostore_sdk.models.data.data(), ) + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return PipelineRunResultList( + ) + """ + + def testPipelineRunResultList(self): + """Test PipelineRunResultList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_result_vote.py b/test/test_pipeline_run_result_vote.py new file mode 100644 index 0000000..2d5e527 --- /dev/null +++ b/test/test_pipeline_run_result_vote.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_run_result_vote import PipelineRunResultVote + +class TestPipelineRunResultVote(unittest.TestCase): + """PipelineRunResultVote unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineRunResultVote: + """Test PipelineRunResultVote + 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 `PipelineRunResultVote` + """ + model = PipelineRunResultVote() + if include_optional: + return PipelineRunResultVote( + id = '', + pipeline_run_result_id = '', + user_id = '', + vote = 56 + ) + else: + return PipelineRunResultVote( + ) + """ + + def testPipelineRunResultVote(self): + """Test PipelineRunResultVote""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_result_vote_list.py b/test/test_pipeline_run_result_vote_list.py new file mode 100644 index 0000000..8b2c31c --- /dev/null +++ b/test/test_pipeline_run_result_vote_list.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.pipeline_run_result_vote_list import PipelineRunResultVoteList + +class TestPipelineRunResultVoteList(unittest.TestCase): + """PipelineRunResultVoteList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PipelineRunResultVoteList: + """Test PipelineRunResultVoteList + 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 `PipelineRunResultVoteList` + """ + model = PipelineRunResultVoteList() + if include_optional: + return PipelineRunResultVoteList( + results = [ + neurostore_sdk.models.pipeline_run_result_vote.pipeline-run-result-vote( + id = '', + pipeline_run_result_id = '', + user_id = '', + vote = 56, ) + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return PipelineRunResultVoteList( + ) + """ + + def testPipelineRunResultVoteList(self): + """Test PipelineRunResultVoteList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_result_votes_api.py b/test/test_pipeline_run_result_votes_api.py new file mode 100644 index 0000000..92f4133 --- /dev/null +++ b/test/test_pipeline_run_result_votes_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.pipeline_run_result_votes_api import PipelineRunResultVotesApi + + +class TestPipelineRunResultVotesApi(unittest.TestCase): + """PipelineRunResultVotesApi unit test stubs""" + + def setUp(self) -> None: + self.api = PipelineRunResultVotesApi() + + def tearDown(self) -> None: + pass + + def test_pipeline_run_result_votes_get(self) -> None: + """Test case for pipeline_run_result_votes_get + + GET a list of pipeline run result votes + """ + pass + + def test_pipeline_run_result_votes_pipeline_run_result_vote_id_delete(self) -> None: + """Test case for pipeline_run_result_votes_pipeline_run_result_vote_id_delete + + DELETE a pipeline run result vote by ID + """ + pass + + def test_pipeline_run_result_votes_pipeline_run_result_vote_id_get(self) -> None: + """Test case for pipeline_run_result_votes_pipeline_run_result_vote_id_get + + GET a pipeline run result vote by ID + """ + pass + + def test_pipeline_run_result_votes_pipeline_run_result_vote_id_put(self) -> None: + """Test case for pipeline_run_result_votes_pipeline_run_result_vote_id_put + + PUT/update a pipeline run result vote by ID + """ + pass + + def test_pipeline_run_result_votes_post(self) -> None: + """Test case for pipeline_run_result_votes_post + + POST/create a pipeline run result vote + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_run_results_api.py b/test/test_pipeline_run_results_api.py new file mode 100644 index 0000000..45622d8 --- /dev/null +++ b/test/test_pipeline_run_results_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.pipeline_run_results_api import PipelineRunResultsApi + + +class TestPipelineRunResultsApi(unittest.TestCase): + """PipelineRunResultsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PipelineRunResultsApi() + + def tearDown(self) -> None: + pass + + def test_pipeline_run_results_get(self) -> None: + """Test case for pipeline_run_results_get + + GET a list of pipeline run results + """ + pass + + def test_pipeline_run_results_pipeline_run_result_id_delete(self) -> None: + """Test case for pipeline_run_results_pipeline_run_result_id_delete + + DELETE a pipeline run result by ID + """ + pass + + def test_pipeline_run_results_pipeline_run_result_id_get(self) -> None: + """Test case for pipeline_run_results_pipeline_run_result_id_get + + GET a pipeline run result by ID + """ + pass + + def test_pipeline_run_results_pipeline_run_result_id_put(self) -> None: + """Test case for pipeline_run_results_pipeline_run_result_id_put + + PUT/update a pipeline run result by ID + """ + pass + + def test_pipeline_run_results_post(self) -> None: + """Test case for pipeline_run_results_post + + POST/create a pipeline run result + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipeline_runs_api.py b/test/test_pipeline_runs_api.py new file mode 100644 index 0000000..9cbaa30 --- /dev/null +++ b/test/test_pipeline_runs_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.pipeline_runs_api import PipelineRunsApi + + +class TestPipelineRunsApi(unittest.TestCase): + """PipelineRunsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PipelineRunsApi() + + def tearDown(self) -> None: + pass + + def test_pipeline_runs_get(self) -> None: + """Test case for pipeline_runs_get + + GET a list of pipeline runs + """ + pass + + def test_pipeline_runs_pipeline_run_id_delete(self) -> None: + """Test case for pipeline_runs_pipeline_run_id_delete + + DELETE a pipeline run by ID + """ + pass + + def test_pipeline_runs_pipeline_run_id_get(self) -> None: + """Test case for pipeline_runs_pipeline_run_id_get + + GET a pipeline run by ID + """ + pass + + def test_pipeline_runs_pipeline_run_id_put(self) -> None: + """Test case for pipeline_runs_pipeline_run_id_put + + PUT/update a pipeline run by ID + """ + pass + + def test_pipeline_runs_post(self) -> None: + """Test case for pipeline_runs_post + + POST/create a pipeline run + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pipelines_api.py b/test/test_pipelines_api.py new file mode 100644 index 0000000..7c9c7fa --- /dev/null +++ b/test/test_pipelines_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.pipelines_api import PipelinesApi + + +class TestPipelinesApi(unittest.TestCase): + """PipelinesApi unit test stubs""" + + def setUp(self) -> None: + self.api = PipelinesApi() + + def tearDown(self) -> None: + pass + + def test_pipelines_get(self) -> None: + """Test case for pipelines_get + + GET a list of pipelines + """ + pass + + def test_pipelines_id_delete(self) -> None: + """Test case for pipelines_id_delete + + DELETE a pipeline by ID + """ + pass + + def test_pipelines_id_get(self) -> None: + """Test case for pipelines_id_get + + GET a pipeline by ID + """ + pass + + def test_pipelines_id_put(self) -> None: + """Test case for pipelines_id_put + + PUT/update a pipeline by ID + """ + pass + + def test_pipelines_post(self) -> None: + """Test case for pipelines_post + + POST/create a pipeline + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_base.py b/test/test_point_base.py new file mode 100644 index 0000000..9cf5720 --- /dev/null +++ b/test/test_point_base.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_base import PointBase + +class TestPointBase(unittest.TestCase): + """PointBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointBase: + """Test PointBase + 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 `PointBase` + """ + model = PointBase() + if include_optional: + return PointBase( + coordinates = [ + 63 + ], + space = 'MNI', + kind = '', + label_id = '' + ) + else: + return PointBase( + ) + """ + + def testPointBase(self): + """Test PointBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_common.py b/test/test_point_common.py new file mode 100644 index 0000000..11de228 --- /dev/null +++ b/test/test_point_common.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_common import PointCommon + +class TestPointCommon(unittest.TestCase): + """PointCommon unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointCommon: + """Test PointCommon + 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 `PointCommon` + """ + model = PointCommon() + if include_optional: + return PointCommon( + analysis = '', + cluster_size = 1.337, + subpeak = True, + order = 56 + ) + else: + return PointCommon( + ) + """ + + def testPointCommon(self): + """Test PointCommon""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_list.py b/test/test_point_list.py new file mode 100644 index 0000000..05c65b6 --- /dev/null +++ b/test/test_point_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_list import PointList + +class TestPointList(unittest.TestCase): + """PointList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointList: + """Test PointList + 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 `PointList` + """ + model = PointList() + if include_optional: + return PointList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return PointList( + ) + """ + + def testPointList(self): + """Test PointList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_relationships.py b/test/test_point_relationships.py new file mode 100644 index 0000000..a04dced --- /dev/null +++ b/test/test_point_relationships.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_relationships import PointRelationships + +class TestPointRelationships(unittest.TestCase): + """PointRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointRelationships: + """Test PointRelationships + 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 `PointRelationships` + """ + model = PointRelationships() + if include_optional: + return PointRelationships( + image = '', + values = None, + x = 1.337, + y = 1.337, + z = 1.337, + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ] + ) + else: + return PointRelationships( + ) + """ + + def testPointRelationships(self): + """Test PointRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_relationships_values.py b/test/test_point_relationships_values.py new file mode 100644 index 0000000..d21d746 --- /dev/null +++ b/test/test_point_relationships_values.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_relationships_values import PointRelationshipsValues + +class TestPointRelationshipsValues(unittest.TestCase): + """PointRelationshipsValues unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointRelationshipsValues: + """Test PointRelationshipsValues + 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 `PointRelationshipsValues` + """ + model = PointRelationshipsValues() + if include_optional: + return PointRelationshipsValues( + ) + else: + return PointRelationshipsValues( + ) + """ + + def testPointRelationshipsValues(self): + """Test PointRelationshipsValues""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_request.py b/test/test_point_request.py new file mode 100644 index 0000000..cdfe5bd --- /dev/null +++ b/test/test_point_request.py @@ -0,0 +1,74 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_request import PointRequest + +class TestPointRequest(unittest.TestCase): + """PointRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointRequest: + """Test PointRequest + 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 `PointRequest` + """ + model = PointRequest() + if include_optional: + return PointRequest( + coordinates = [ + 63 + ], + space = 'MNI', + kind = '', + label_id = '', + image = '', + values = None, + x = 1.337, + y = 1.337, + z = 1.337, + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + id = '38jobTomPDqt', + public = True, + analysis = '', + cluster_size = 1.337, + subpeak = True, + order = 56 + ) + else: + return PointRequest( + ) + """ + + def testPointRequest(self): + """Test PointRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_return.py b/test/test_point_return.py new file mode 100644 index 0000000..1ad0c84 --- /dev/null +++ b/test/test_point_return.py @@ -0,0 +1,78 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_return import PointReturn + +class TestPointReturn(unittest.TestCase): + """PointReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointReturn: + """Test PointReturn + 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 `PointReturn` + """ + model = PointReturn() + if include_optional: + return PointReturn( + coordinates = [ + 63 + ], + space = 'MNI', + kind = '', + label_id = '', + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '', + image = '', + values = None, + x = 1.337, + y = 1.337, + z = 1.337, + entities = [ + neurostore_sdk.models.entity.entity( + label = '', + level = '', + analysis = '', ) + ], + analysis = '', + cluster_size = 1.337, + subpeak = True, + order = 56 + ) + else: + return PointReturn( + ) + """ + + def testPointReturn(self): + """Test PointReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_point_value.py b/test/test_point_value.py new file mode 100644 index 0000000..5adeb89 --- /dev/null +++ b/test/test_point_value.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.point_value import PointValue + +class TestPointValue(unittest.TestCase): + """PointValue unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> PointValue: + """Test PointValue + 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 `PointValue` + """ + model = PointValue() + if include_optional: + return PointValue( + kind = '', + value = 1.337 + ) + else: + return PointValue( + ) + """ + + def testPointValue(self): + """Test PointValue""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_points_api.py b/test/test_points_api.py new file mode 100644 index 0000000..cb92122 --- /dev/null +++ b/test/test_points_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.points_api import PointsApi + + +class TestPointsApi(unittest.TestCase): + """PointsApi unit test stubs""" + + def setUp(self) -> None: + self.api = PointsApi() + + def tearDown(self) -> None: + pass + + def test_points_get(self) -> None: + """Test case for points_get + + Get Points + """ + pass + + def test_points_id_delete(self) -> None: + """Test case for points_id_delete + + DELETE a point + """ + pass + + def test_points_id_get(self) -> None: + """Test case for points_id_get + + GET a point + """ + pass + + def test_points_id_put(self) -> None: + """Test case for points_id_put + + PUT/update a point + """ + pass + + def test_points_post(self) -> None: + """Test case for points_post + + POST Points + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_resource_attributes.py b/test/test_resource_attributes.py new file mode 100644 index 0000000..9fdedd8 --- /dev/null +++ b/test/test_resource_attributes.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.resource_attributes import ResourceAttributes + +class TestResourceAttributes(unittest.TestCase): + """ResourceAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ResourceAttributes: + """Test ResourceAttributes + 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 `ResourceAttributes` + """ + model = ResourceAttributes() + if include_optional: + return ResourceAttributes( + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '' + ) + else: + return ResourceAttributes( + ) + """ + + def testResourceAttributes(self): + """Test ResourceAttributes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_store_api.py b/test/test_store_api.py new file mode 100644 index 0000000..009bf2b --- /dev/null +++ b/test/test_store_api.py @@ -0,0 +1,326 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.store_api import StoreApi + + +class TestStoreApi(unittest.TestCase): + """StoreApi unit test stubs""" + + def setUp(self) -> None: + self.api = StoreApi() + + def tearDown(self) -> None: + pass + + def test_analyses_get(self) -> None: + """Test case for analyses_get + + GET list of analyses + """ + pass + + def test_analyses_id_delete(self) -> None: + """Test case for analyses_id_delete + + DELETE an analysis + """ + pass + + def test_analyses_id_get(self) -> None: + """Test case for analyses_id_get + + GET an analysis + """ + pass + + def test_analyses_id_put(self) -> None: + """Test case for analyses_id_put + + PUT/update an analysis + """ + pass + + def test_analyses_post(self) -> None: + """Test case for analyses_post + + POST/create an analysis + """ + pass + + def test_annotation_analyses_get(self) -> None: + """Test case for annotation_analyses_get + + Get annotation analyses + """ + pass + + def test_annotation_analyses_id_get(self) -> None: + """Test case for annotation_analyses_id_get + + Your GET endpoint + """ + pass + + def test_annotation_analyses_id_put(self) -> None: + """Test case for annotation_analyses_id_put + + Your PUT endpoint + """ + pass + + def test_annotation_analyses_post(self) -> None: + """Test case for annotation_analyses_post + + Your POST endpoint + """ + pass + + def test_annotations_get(self) -> None: + """Test case for annotations_get + + Your GET endpoint + """ + pass + + def test_annotations_id_delete(self) -> None: + """Test case for annotations_id_delete + + DELETE an annotation + """ + pass + + def test_annotations_id_get(self) -> None: + """Test case for annotations_id_get + + Your GET endpoint + """ + pass + + def test_annotations_id_put(self) -> None: + """Test case for annotations_id_put + + Update an annotation + """ + pass + + def test_annotations_post(self) -> None: + """Test case for annotations_post + + Post Annotation + """ + pass + + def test_base_studies_get(self) -> None: + """Test case for base_studies_get + + + """ + pass + + def test_base_studies_id_get(self) -> None: + """Test case for base_studies_id_get + + Your GET endpoint + """ + pass + + def test_base_studies_id_put(self) -> None: + """Test case for base_studies_id_put + + + """ + pass + + def test_base_studies_post(self) -> None: + """Test case for base_studies_post + + + """ + pass + + def test_conditions_get(self) -> None: + """Test case for conditions_get + + GET Conditions + """ + pass + + def test_conditions_id_delete(self) -> None: + """Test case for conditions_id_delete + + DELETE a condition + """ + pass + + def test_conditions_id_get(self) -> None: + """Test case for conditions_id_get + + GET a condition + """ + pass + + def test_conditions_id_put(self) -> None: + """Test case for conditions_id_put + + PUT/update a condition + """ + pass + + def test_conditions_post(self) -> None: + """Test case for conditions_post + + POST/Create a condition + """ + pass + + def test_images_get(self) -> None: + """Test case for images_get + + GET a list of images + """ + pass + + def test_images_id_delete(self) -> None: + """Test case for images_id_delete + + DELETE an image + """ + pass + + def test_images_id_get(self) -> None: + """Test case for images_id_get + + GET an image + """ + pass + + def test_images_id_put(self) -> None: + """Test case for images_id_put + + PUT/update an image + """ + pass + + def test_images_post(self) -> None: + """Test case for images_post + + POST/create an image + """ + pass + + def test_points_get(self) -> None: + """Test case for points_get + + Get Points + """ + pass + + def test_points_id_delete(self) -> None: + """Test case for points_id_delete + + DELETE a point + """ + pass + + def test_points_id_get(self) -> None: + """Test case for points_id_get + + GET a point + """ + pass + + def test_points_id_put(self) -> None: + """Test case for points_id_put + + PUT/update a point + """ + pass + + def test_points_post(self) -> None: + """Test case for points_post + + POST Points + """ + pass + + def test_studies_get(self) -> None: + """Test case for studies_get + + GET a list of studies + """ + pass + + def test_studies_id_delete(self) -> None: + """Test case for studies_id_delete + + DELETE a study + """ + pass + + def test_studies_id_get(self) -> None: + """Test case for studies_id_get + + GET a study + """ + pass + + def test_studies_id_put(self) -> None: + """Test case for studies_id_put + + PUT/update a study + """ + pass + + def test_studies_post(self) -> None: + """Test case for studies_post + + POST/create a study + """ + pass + + def test_studysets_id_delete(self) -> None: + """Test case for studysets_id_delete + + DELETE a studyset + """ + pass + + def test_studysets_id_get(self) -> None: + """Test case for studysets_id_get + + GET a studyset + """ + pass + + def test_studysets_id_put(self) -> None: + """Test case for studysets_id_put + + PUT/update a studyset + """ + pass + + def test_studysets_post(self) -> None: + """Test case for studysets_post + + POST/create a studyset + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studies_api.py b/test/test_studies_api.py new file mode 100644 index 0000000..9fb8d31 --- /dev/null +++ b/test/test_studies_api.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.studies_api import StudiesApi + + +class TestStudiesApi(unittest.TestCase): + """StudiesApi unit test stubs""" + + def setUp(self) -> None: + self.api = StudiesApi() + + def tearDown(self) -> None: + pass + + def test_base_studies_get(self) -> None: + """Test case for base_studies_get + + + """ + pass + + def test_base_studies_id_get(self) -> None: + """Test case for base_studies_id_get + + Your GET endpoint + """ + pass + + def test_base_studies_id_put(self) -> None: + """Test case for base_studies_id_put + + + """ + pass + + def test_base_studies_post(self) -> None: + """Test case for base_studies_post + + + """ + pass + + def test_studies_get(self) -> None: + """Test case for studies_get + + GET a list of studies + """ + pass + + def test_studies_id_delete(self) -> None: + """Test case for studies_id_delete + + DELETE a study + """ + pass + + def test_studies_id_get(self) -> None: + """Test case for studies_id_get + + GET a study + """ + pass + + def test_studies_id_put(self) -> None: + """Test case for studies_id_put + + PUT/update a study + """ + pass + + def test_studies_post(self) -> None: + """Test case for studies_post + + POST/create a study + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_base.py b/test/test_study_base.py new file mode 100644 index 0000000..5356d1b --- /dev/null +++ b/test/test_study_base.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_base import StudyBase + +class TestStudyBase(unittest.TestCase): + """StudyBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyBase: + """Test StudyBase + 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 `StudyBase` + """ + model = StudyBase() + if include_optional: + return StudyBase( + doi = '10.1016/S0926-6410(97)00020-7', + name = 'Functional magnetic resonance imaging of category-specific cortical activation: evidence for semantic maps.', + metadata = neurostore_sdk.models.metadata.metadata(), + description = 'This is my very scientific abstract.', + publication = 'Journal of Super Important Science.', + pmid = '35998675', + authors = 'Strange, M.', + year = 1991 + ) + else: + return StudyBase( + ) + """ + + def testStudyBase(self): + """Test StudyBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_common.py b/test/test_study_common.py new file mode 100644 index 0000000..86a680e --- /dev/null +++ b/test/test_study_common.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_common import StudyCommon + +class TestStudyCommon(unittest.TestCase): + """StudyCommon unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyCommon: + """Test StudyCommon + 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 `StudyCommon` + """ + model = StudyCommon() + if include_optional: + return StudyCommon( + level = 'group' + ) + else: + return StudyCommon( + ) + """ + + def testStudyCommon(self): + """Test StudyCommon""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_list.py b/test/test_study_list.py new file mode 100644 index 0000000..f6916e8 --- /dev/null +++ b/test/test_study_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_list import StudyList + +class TestStudyList(unittest.TestCase): + """StudyList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyList: + """Test StudyList + 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 `StudyList` + """ + model = StudyList() + if include_optional: + return StudyList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return StudyList( + ) + """ + + def testStudyList(self): + """Test StudyList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_request.py b/test/test_study_request.py new file mode 100644 index 0000000..18bd964 --- /dev/null +++ b/test/test_study_request.py @@ -0,0 +1,63 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_request import StudyRequest + +class TestStudyRequest(unittest.TestCase): + """StudyRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyRequest: + """Test StudyRequest + 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 `StudyRequest` + """ + model = StudyRequest() + if include_optional: + return StudyRequest( + doi = '10.1016/S0926-6410(97)00020-7', + name = 'Functional magnetic resonance imaging of category-specific cortical activation: evidence for semantic maps.', + metadata = neurostore_sdk.models.metadata.metadata(), + description = 'This is my very scientific abstract.', + publication = 'Journal of Super Important Science.', + pmid = '35998675', + authors = 'Strange, M.', + year = 1991, + analyses = None, + id = '38jobTomPDqt', + public = True, + pmcid = '' + ) + else: + return StudyRequest( + ) + """ + + def testStudyRequest(self): + """Test StudyRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_request_relationships.py b/test/test_study_request_relationships.py new file mode 100644 index 0000000..e619fa2 --- /dev/null +++ b/test/test_study_request_relationships.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_request_relationships import StudyRequestRelationships + +class TestStudyRequestRelationships(unittest.TestCase): + """StudyRequestRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyRequestRelationships: + """Test StudyRequestRelationships + 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 `StudyRequestRelationships` + """ + model = StudyRequestRelationships() + if include_optional: + return StudyRequestRelationships( + analyses = None + ) + else: + return StudyRequestRelationships( + ) + """ + + def testStudyRequestRelationships(self): + """Test StudyRequestRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_request_relationships_analyses.py b/test/test_study_request_relationships_analyses.py new file mode 100644 index 0000000..84887b2 --- /dev/null +++ b/test/test_study_request_relationships_analyses.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_request_relationships_analyses import StudyRequestRelationshipsAnalyses + +class TestStudyRequestRelationshipsAnalyses(unittest.TestCase): + """StudyRequestRelationshipsAnalyses unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyRequestRelationshipsAnalyses: + """Test StudyRequestRelationshipsAnalyses + 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 `StudyRequestRelationshipsAnalyses` + """ + model = StudyRequestRelationshipsAnalyses() + if include_optional: + return StudyRequestRelationshipsAnalyses( + ) + else: + return StudyRequestRelationshipsAnalyses( + ) + """ + + def testStudyRequestRelationshipsAnalyses(self): + """Test StudyRequestRelationshipsAnalyses""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_return.py b/test/test_study_return.py new file mode 100644 index 0000000..840e58a --- /dev/null +++ b/test/test_study_return.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_return import StudyReturn + +class TestStudyReturn(unittest.TestCase): + """StudyReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyReturn: + """Test StudyReturn + 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 `StudyReturn` + """ + model = StudyReturn() + if include_optional: + return StudyReturn( + doi = '10.1016/S0926-6410(97)00020-7', + name = 'Functional magnetic resonance imaging of category-specific cortical activation: evidence for semantic maps.', + metadata = neurostore_sdk.models.metadata.metadata(), + description = 'This is my very scientific abstract.', + publication = 'Journal of Super Important Science.', + pmid = '35998675', + authors = 'Strange, M.', + year = 1991, + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '', + source = '', + source_id = '', + source_updated_at = '', + analyses = None, + studysets = [ + null + ], + has_coordinates = True, + has_images = True, + base_study = '', + pmcid = '' + ) + else: + return StudyReturn( + ) + """ + + def testStudyReturn(self): + """Test StudyReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_return_all_of_studysets.py b/test/test_study_return_all_of_studysets.py new file mode 100644 index 0000000..d751dec --- /dev/null +++ b/test/test_study_return_all_of_studysets.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_return_all_of_studysets import StudyReturnAllOfStudysets + +class TestStudyReturnAllOfStudysets(unittest.TestCase): + """StudyReturnAllOfStudysets unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyReturnAllOfStudysets: + """Test StudyReturnAllOfStudysets + 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 `StudyReturnAllOfStudysets` + """ + model = StudyReturnAllOfStudysets() + if include_optional: + return StudyReturnAllOfStudysets( + name = '', + id = '', + description = '' + ) + else: + return StudyReturnAllOfStudysets( + ) + """ + + def testStudyReturnAllOfStudysets(self): + """Test StudyReturnAllOfStudysets""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_return_all_of_studysets_one_of.py b/test/test_study_return_all_of_studysets_one_of.py new file mode 100644 index 0000000..22ea552 --- /dev/null +++ b/test/test_study_return_all_of_studysets_one_of.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_return_all_of_studysets_one_of import StudyReturnAllOfStudysetsOneOf + +class TestStudyReturnAllOfStudysetsOneOf(unittest.TestCase): + """StudyReturnAllOfStudysetsOneOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyReturnAllOfStudysetsOneOf: + """Test StudyReturnAllOfStudysetsOneOf + 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 `StudyReturnAllOfStudysetsOneOf` + """ + model = StudyReturnAllOfStudysetsOneOf() + if include_optional: + return StudyReturnAllOfStudysetsOneOf( + name = '', + id = '', + description = '' + ) + else: + return StudyReturnAllOfStudysetsOneOf( + ) + """ + + def testStudyReturnAllOfStudysetsOneOf(self): + """Test StudyReturnAllOfStudysetsOneOf""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_return_relationships.py b/test/test_study_return_relationships.py new file mode 100644 index 0000000..73a61c2 --- /dev/null +++ b/test/test_study_return_relationships.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_return_relationships import StudyReturnRelationships + +class TestStudyReturnRelationships(unittest.TestCase): + """StudyReturnRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyReturnRelationships: + """Test StudyReturnRelationships + 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 `StudyReturnRelationships` + """ + model = StudyReturnRelationships() + if include_optional: + return StudyReturnRelationships( + analyses = None + ) + else: + return StudyReturnRelationships( + ) + """ + + def testStudyReturnRelationships(self): + """Test StudyReturnRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_study_return_relationships_analyses.py b/test/test_study_return_relationships_analyses.py new file mode 100644 index 0000000..5bc1a8b --- /dev/null +++ b/test/test_study_return_relationships_analyses.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.study_return_relationships_analyses import StudyReturnRelationshipsAnalyses + +class TestStudyReturnRelationshipsAnalyses(unittest.TestCase): + """StudyReturnRelationshipsAnalyses unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudyReturnRelationshipsAnalyses: + """Test StudyReturnRelationshipsAnalyses + 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 `StudyReturnRelationshipsAnalyses` + """ + model = StudyReturnRelationshipsAnalyses() + if include_optional: + return StudyReturnRelationshipsAnalyses( + ) + else: + return StudyReturnRelationshipsAnalyses( + ) + """ + + def testStudyReturnRelationshipsAnalyses(self): + """Test StudyReturnRelationshipsAnalyses""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_base.py b/test/test_studyset_base.py new file mode 100644 index 0000000..33e3e98 --- /dev/null +++ b/test/test_studyset_base.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_base import StudysetBase + +class TestStudysetBase(unittest.TestCase): + """StudysetBase unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetBase: + """Test StudysetBase + 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 `StudysetBase` + """ + model = StudysetBase() + if include_optional: + return StudysetBase( + name = 'Examination of want versus need', + description = 'A collection of studies that include tasks x, y, and z, for the purpose of teasing apart concepts a and b.', + publication = 'Journal of Open Results', + doi = 'digital object identifier of the studyset', + pmid = '35998675' + ) + else: + return StudysetBase( + ) + """ + + def testStudysetBase(self): + """Test StudysetBase""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_list.py b/test/test_studyset_list.py new file mode 100644 index 0000000..a373556 --- /dev/null +++ b/test/test_studyset_list.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_list import StudysetList + +class TestStudysetList(unittest.TestCase): + """StudysetList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetList: + """Test StudysetList + 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 `StudysetList` + """ + model = StudysetList() + if include_optional: + return StudysetList( + results = [ + null + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return StudysetList( + ) + """ + + def testStudysetList(self): + """Test StudysetList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_request.py b/test/test_studyset_request.py new file mode 100644 index 0000000..e573fe6 --- /dev/null +++ b/test/test_studyset_request.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_request import StudysetRequest + +class TestStudysetRequest(unittest.TestCase): + """StudysetRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetRequest: + """Test StudysetRequest + 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 `StudysetRequest` + """ + model = StudysetRequest() + if include_optional: + return StudysetRequest( + name = 'Examination of want versus need', + description = 'A collection of studies that include tasks x, y, and z, for the purpose of teasing apart concepts a and b.', + publication = 'Journal of Open Results', + doi = 'digital object identifier of the studyset', + pmid = '35998675', + studies = [ + None + ], + id = '38jobTomPDqt', + public = True, + level = 'group' + ) + else: + return StudysetRequest( + ) + """ + + def testStudysetRequest(self): + """Test StudysetRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_request_relationships.py b/test/test_studyset_request_relationships.py new file mode 100644 index 0000000..bcbf059 --- /dev/null +++ b/test/test_studyset_request_relationships.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_request_relationships import StudysetRequestRelationships + +class TestStudysetRequestRelationships(unittest.TestCase): + """StudysetRequestRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetRequestRelationships: + """Test StudysetRequestRelationships + 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 `StudysetRequestRelationships` + """ + model = StudysetRequestRelationships() + if include_optional: + return StudysetRequestRelationships( + studies = [ + null + ] + ) + else: + return StudysetRequestRelationships( + ) + """ + + def testStudysetRequestRelationships(self): + """Test StudysetRequestRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_return.py b/test/test_studyset_return.py new file mode 100644 index 0000000..5991f30 --- /dev/null +++ b/test/test_studyset_return.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_return import StudysetReturn + +class TestStudysetReturn(unittest.TestCase): + """StudysetReturn unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetReturn: + """Test StudysetReturn + 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 `StudysetReturn` + """ + model = StudysetReturn() + if include_optional: + return StudysetReturn( + name = 'Examination of want versus need', + description = 'A collection of studies that include tasks x, y, and z, for the purpose of teasing apart concepts a and b.', + publication = 'Journal of Open Results', + doi = 'digital object identifier of the studyset', + pmid = '35998675', + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True, + user = '', + username = '', + source = '', + source_id = '', + source_updated_at = '', + studies = None, + level = 'group' + ) + else: + return StudysetReturn( + ) + """ + + def testStudysetReturn(self): + """Test StudysetReturn""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_return_relationships.py b/test/test_studyset_return_relationships.py new file mode 100644 index 0000000..52875b9 --- /dev/null +++ b/test/test_studyset_return_relationships.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_return_relationships import StudysetReturnRelationships + +class TestStudysetReturnRelationships(unittest.TestCase): + """StudysetReturnRelationships unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetReturnRelationships: + """Test StudysetReturnRelationships + 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 `StudysetReturnRelationships` + """ + model = StudysetReturnRelationships() + if include_optional: + return StudysetReturnRelationships( + studies = None + ) + else: + return StudysetReturnRelationships( + ) + """ + + def testStudysetReturnRelationships(self): + """Test StudysetReturnRelationships""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studyset_return_relationships_studies.py b/test/test_studyset_return_relationships_studies.py new file mode 100644 index 0000000..4f84d42 --- /dev/null +++ b/test/test_studyset_return_relationships_studies.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studyset_return_relationships_studies import StudysetReturnRelationshipsStudies + +class TestStudysetReturnRelationshipsStudies(unittest.TestCase): + """StudysetReturnRelationshipsStudies unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetReturnRelationshipsStudies: + """Test StudysetReturnRelationshipsStudies + 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 `StudysetReturnRelationshipsStudies` + """ + model = StudysetReturnRelationshipsStudies() + if include_optional: + return StudysetReturnRelationshipsStudies( + ) + else: + return StudysetReturnRelationshipsStudies( + ) + """ + + def testStudysetReturnRelationshipsStudies(self): + """Test StudysetReturnRelationshipsStudies""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studysets_api.py b/test/test_studysets_api.py new file mode 100644 index 0000000..19b5ed7 --- /dev/null +++ b/test/test_studysets_api.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.studysets_api import StudysetsApi + + +class TestStudysetsApi(unittest.TestCase): + """StudysetsApi unit test stubs""" + + def setUp(self) -> None: + self.api = StudysetsApi() + + def tearDown(self) -> None: + pass + + def test_studysets_get(self) -> None: + """Test case for studysets_get + + GET a list of studysets + """ + pass + + def test_studysets_id_delete(self) -> None: + """Test case for studysets_id_delete + + DELETE a studyset + """ + pass + + def test_studysets_id_get(self) -> None: + """Test case for studysets_id_get + + GET a studyset + """ + pass + + def test_studysets_id_put(self) -> None: + """Test case for studysets_id_put + + PUT/update a studyset + """ + pass + + def test_studysets_post(self) -> None: + """Test case for studysets_post + + POST/create a studyset + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studysets_id_get404_response.py b/test/test_studysets_id_get404_response.py new file mode 100644 index 0000000..ba12524 --- /dev/null +++ b/test/test_studysets_id_get404_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studysets_id_get404_response import StudysetsIdGet404Response + +class TestStudysetsIdGet404Response(unittest.TestCase): + """StudysetsIdGet404Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetsIdGet404Response: + """Test StudysetsIdGet404Response + 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 `StudysetsIdGet404Response` + """ + model = StudysetsIdGet404Response() + if include_optional: + return StudysetsIdGet404Response( + detail = '"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again."', + status = 404, + title = '"Not Found"', + type = '"about:blank"' + ) + else: + return StudysetsIdGet404Response( + ) + """ + + def testStudysetsIdGet404Response(self): + """Test StudysetsIdGet404Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_studysets_id_put422_response.py b/test/test_studysets_id_put422_response.py new file mode 100644 index 0000000..95f789b --- /dev/null +++ b/test/test_studysets_id_put422_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.studysets_id_put422_response import StudysetsIdPut422Response + +class TestStudysetsIdPut422Response(unittest.TestCase): + """StudysetsIdPut422Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudysetsIdPut422Response: + """Test StudysetsIdPut422Response + 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 `StudysetsIdPut422Response` + """ + model = StudysetsIdPut422Response() + if include_optional: + return StudysetsIdPut422Response( + detail = 'The request was well-formed but was unable to be followed due to semantic errors.', + status = 56, + title = 'Unprocessable Entity', + type = 'about:blank' + ) + else: + return StudysetsIdPut422Response( + ) + """ + + def testStudysetsIdPut422Response(self): + """Test StudysetsIdPut422Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_user.py b/test/test_user.py new file mode 100644 index 0000000..c19e532 --- /dev/null +++ b/test/test_user.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.user import User + +class TestUser(unittest.TestCase): + """User unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> User: + """Test User + 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 `User` + """ + model = User() + if include_optional: + return User( + name = '', + neuroid = '' + ) + else: + return User( + ) + """ + + def testUser(self): + """Test User""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_user_api.py b/test/test_user_api.py new file mode 100644 index 0000000..015445e --- /dev/null +++ b/test/test_user_api.py @@ -0,0 +1,60 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.api.user_api import UserApi + + +class TestUserApi(unittest.TestCase): + """UserApi unit test stubs""" + + def setUp(self) -> None: + self.api = UserApi() + + def tearDown(self) -> None: + pass + + def test_users_get(self) -> None: + """Test case for users_get + + Your GET endpoint + """ + pass + + def test_users_id_get(self) -> None: + """Test case for users_id_get + + Individual User Profile + """ + pass + + def test_users_id_put(self) -> None: + """Test case for users_id_put + + Update Individual Profile + """ + pass + + def test_users_post(self) -> None: + """Test case for users_post + + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_user_list.py b/test/test_user_list.py new file mode 100644 index 0000000..d6290e5 --- /dev/null +++ b/test/test_user_list.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.user_list import UserList + +class TestUserList(unittest.TestCase): + """UserList unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserList: + """Test UserList + 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 `UserList` + """ + model = UserList() + if include_optional: + return UserList( + results = [ + neurostore_sdk.models.user.user( + name = '', + neuroid = '', ) + ], + metadata = neurostore_sdk.models.metadata.metadata( + total_count = 56, + unique_count = 56, ) + ) + else: + return UserList( + ) + """ + + def testUserList(self): + """Test UserList""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_userless_resource_attributes.py b/test/test_userless_resource_attributes.py new file mode 100644 index 0000000..ef03e22 --- /dev/null +++ b/test/test_userless_resource_attributes.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + neurostore api + + Create studysets for meta-analysis + + The version of the OpenAPI document: 1.0 + Contact: jamesdkent21@gmail.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from neurostore_sdk.models.userless_resource_attributes import UserlessResourceAttributes + +class TestUserlessResourceAttributes(unittest.TestCase): + """UserlessResourceAttributes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UserlessResourceAttributes: + """Test UserlessResourceAttributes + 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 `UserlessResourceAttributes` + """ + model = UserlessResourceAttributes() + if include_optional: + return UserlessResourceAttributes( + created_at = '2021-01-16T20:50:38.009318Z', + updated_at = '', + id = '38jobTomPDqt', + public = True + ) + else: + return UserlessResourceAttributes( + ) + """ + + def testUserlessResourceAttributes(self): + """Test UserlessResourceAttributes""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()