diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b0b7f0e..20b3b9a 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 d25fe40..cad51ef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,12 +14,18 @@ stages: - pip install -r test-requirements.txt - pytest --cov=neurosynth_compose_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 cb8b229..b8e2571 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,7 +8,6 @@ docs/AnnotationList.md docs/AnnotationPostBody.md docs/AnnotationReturn.md docs/AnnotationUpdate.md -docs/AnnotationUpdateAllOf.md docs/AnnotationsApi.md docs/ComposeApi.md docs/Corrector.md @@ -29,7 +28,6 @@ docs/NeurostoreAnalysis.md docs/NeurostoreStudy.md docs/NeurostoreStudyList.md docs/NeurostoreStudyReturn.md -docs/NeurovaultApi.md docs/NeurovaultCollection.md docs/NeurovaultCollectionFiles.md docs/NeurovaultCollectionReturn.md @@ -77,7 +75,6 @@ neurosynth_compose_sdk/api/compose_api.py neurosynth_compose_sdk/api/default_api.py neurosynth_compose_sdk/api/get_api.py neurosynth_compose_sdk/api/meta_analyses_api.py -neurosynth_compose_sdk/api/neurovault_api.py neurosynth_compose_sdk/api/post_api.py neurosynth_compose_sdk/api/projects_api.py neurosynth_compose_sdk/api/put_api.py @@ -94,7 +91,6 @@ neurosynth_compose_sdk/models/annotation_list.py neurosynth_compose_sdk/models/annotation_post_body.py neurosynth_compose_sdk/models/annotation_return.py neurosynth_compose_sdk/models/annotation_update.py -neurosynth_compose_sdk/models/annotation_update_all_of.py neurosynth_compose_sdk/models/corrector.py neurosynth_compose_sdk/models/estimator.py neurosynth_compose_sdk/models/meta_analyses_get400_response.py @@ -143,6 +139,7 @@ neurosynth_compose_sdk/models/studyset_return.py neurosynth_compose_sdk/models/user.py neurosynth_compose_sdk/models/user_list.py neurosynth_compose_sdk/models/user_return.py +neurosynth_compose_sdk/py.typed neurosynth_compose_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 9e9a0a2..d9fa995 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 c70b974..3b15748 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 neurosynth_compose_sdk from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -101,14 +101,6 @@ Class | Method | HTTP request | Description *ComposeApi* | [**meta_analysis_results_id_get**](docs/ComposeApi.md#meta_analysis_results_id_get) | **GET** /meta-analysis-results/{id} | Your GET endpoint *ComposeApi* | [**meta_analysis_results_id_put**](docs/ComposeApi.md#meta_analysis_results_id_put) | **PUT** /meta-analysis-results/{id} | *ComposeApi* | [**meta_analysis_results_post**](docs/ComposeApi.md#meta_analysis_results_post) | **POST** /meta-analysis-results | -*ComposeApi* | [**neurovault_collections_get**](docs/ComposeApi.md#neurovault_collections_get) | **GET** /neurovault-collections | Get neurovault collections -*ComposeApi* | [**neurovault_collections_id_get**](docs/ComposeApi.md#neurovault_collections_id_get) | **GET** /neurovault-collections/{id} | Your GET endpoint -*ComposeApi* | [**neurovault_collections_id_put**](docs/ComposeApi.md#neurovault_collections_id_put) | **PUT** /neurovault-collections/{id} | -*ComposeApi* | [**neurovault_collections_post**](docs/ComposeApi.md#neurovault_collections_post) | **POST** /neurovault-collections | Create neurovault collection -*ComposeApi* | [**neurovault_files_get**](docs/ComposeApi.md#neurovault_files_get) | **GET** /neurovault-files | Your GET endpoint -*ComposeApi* | [**neurovault_files_id_get**](docs/ComposeApi.md#neurovault_files_id_get) | **GET** /neurovault-files/{id} | Your GET endpoint -*ComposeApi* | [**neurovault_files_id_put**](docs/ComposeApi.md#neurovault_files_id_put) | **PUT** /neurovault-files/{id} | -*ComposeApi* | [**neurovault_files_post**](docs/ComposeApi.md#neurovault_files_post) | **POST** /neurovault-files | *ComposeApi* | [**projects_get**](docs/ComposeApi.md#projects_get) | **GET** /projects | Your GET endpoint *ComposeApi* | [**projects_id_delete**](docs/ComposeApi.md#projects_id_delete) | **DELETE** /projects/{id} | *ComposeApi* | [**projects_id_get**](docs/ComposeApi.md#projects_id_get) | **GET** /projects/{id} | Your GET endpoint @@ -123,10 +115,6 @@ Class | Method | HTTP request | Description *ComposeApi* | [**studysets_id_put**](docs/ComposeApi.md#studysets_id_put) | **PUT** /studysets/{id} | Update a Studyset *ComposeApi* | [**studysets_post**](docs/ComposeApi.md#studysets_post) | **POST** /studysets | Create a new Studyset *DefaultApi* | [**meta_analyses_id_delete**](docs/DefaultApi.md#meta_analyses_id_delete) | **DELETE** /meta-analyses/{id} | -*DefaultApi* | [**neurostore_studies_get**](docs/DefaultApi.md#neurostore_studies_get) | **GET** /neurostore-studies | Your GET endpoint -*DefaultApi* | [**neurostore_studies_id_get**](docs/DefaultApi.md#neurostore_studies_id_get) | **GET** /neurostore-studies/{id} | Your GET endpoint -*DefaultApi* | [**neurostore_studies_id_put**](docs/DefaultApi.md#neurostore_studies_id_put) | **PUT** /neurostore-studies/{id} | -*DefaultApi* | [**neurostore_studies_post**](docs/DefaultApi.md#neurostore_studies_post) | **POST** /neurostore-studies | *DefaultApi* | [**studyset_references_get**](docs/DefaultApi.md#studyset_references_get) | **GET** /studyset-references | Your GET endpoint *DefaultApi* | [**studyset_references_id_get**](docs/DefaultApi.md#studyset_references_id_get) | **GET** /studyset-references/{id} | Your GET endpoint *GetApi* | [**annotations_get**](docs/GetApi.md#annotations_get) | **GET** /annotations | GET a list of annotations @@ -135,10 +123,6 @@ Class | Method | HTTP request | Description *GetApi* | [**meta_analyses_id_get**](docs/GetApi.md#meta_analyses_id_get) | **GET** /meta-analyses/{id} | GET meta-analysis information *GetApi* | [**meta_analysis_results_get**](docs/GetApi.md#meta_analysis_results_get) | **GET** /meta-analysis-results | Your GET endpoint *GetApi* | [**meta_analysis_results_id_get**](docs/GetApi.md#meta_analysis_results_id_get) | **GET** /meta-analysis-results/{id} | Your GET endpoint -*GetApi* | [**neurovault_collections_get**](docs/GetApi.md#neurovault_collections_get) | **GET** /neurovault-collections | Get neurovault collections -*GetApi* | [**neurovault_collections_id_get**](docs/GetApi.md#neurovault_collections_id_get) | **GET** /neurovault-collections/{id} | Your GET endpoint -*GetApi* | [**neurovault_files_get**](docs/GetApi.md#neurovault_files_get) | **GET** /neurovault-files | Your GET endpoint -*GetApi* | [**neurovault_files_id_get**](docs/GetApi.md#neurovault_files_id_get) | **GET** /neurovault-files/{id} | Your GET endpoint *GetApi* | [**projects_get**](docs/GetApi.md#projects_get) | **GET** /projects | Your GET endpoint *GetApi* | [**projects_id_get**](docs/GetApi.md#projects_id_get) | **GET** /projects/{id} | Your GET endpoint *GetApi* | [**specifications_get**](docs/GetApi.md#specifications_get) | **GET** /specifications | Get a list of Specifications @@ -153,19 +137,9 @@ Class | Method | HTTP request | Description *MetaAnalysesApi* | [**meta_analysis_results_id_get**](docs/MetaAnalysesApi.md#meta_analysis_results_id_get) | **GET** /meta-analysis-results/{id} | Your GET endpoint *MetaAnalysesApi* | [**meta_analysis_results_id_put**](docs/MetaAnalysesApi.md#meta_analysis_results_id_put) | **PUT** /meta-analysis-results/{id} | *MetaAnalysesApi* | [**meta_analysis_results_post**](docs/MetaAnalysesApi.md#meta_analysis_results_post) | **POST** /meta-analysis-results | -*NeurovaultApi* | [**neurovault_collections_get**](docs/NeurovaultApi.md#neurovault_collections_get) | **GET** /neurovault-collections | Get neurovault collections -*NeurovaultApi* | [**neurovault_collections_id_get**](docs/NeurovaultApi.md#neurovault_collections_id_get) | **GET** /neurovault-collections/{id} | Your GET endpoint -*NeurovaultApi* | [**neurovault_collections_id_put**](docs/NeurovaultApi.md#neurovault_collections_id_put) | **PUT** /neurovault-collections/{id} | -*NeurovaultApi* | [**neurovault_collections_post**](docs/NeurovaultApi.md#neurovault_collections_post) | **POST** /neurovault-collections | Create neurovault collection -*NeurovaultApi* | [**neurovault_files_get**](docs/NeurovaultApi.md#neurovault_files_get) | **GET** /neurovault-files | Your GET endpoint -*NeurovaultApi* | [**neurovault_files_id_get**](docs/NeurovaultApi.md#neurovault_files_id_get) | **GET** /neurovault-files/{id} | Your GET endpoint -*NeurovaultApi* | [**neurovault_files_id_put**](docs/NeurovaultApi.md#neurovault_files_id_put) | **PUT** /neurovault-files/{id} | -*NeurovaultApi* | [**neurovault_files_post**](docs/NeurovaultApi.md#neurovault_files_post) | **POST** /neurovault-files | *PostApi* | [**annotations_post**](docs/PostApi.md#annotations_post) | **POST** /annotations | Create a new Annotation *PostApi* | [**meta_analyses_post**](docs/PostApi.md#meta_analyses_post) | **POST** /meta-analyses | Create a new meta-analysis *PostApi* | [**meta_analysis_results_post**](docs/PostApi.md#meta_analysis_results_post) | **POST** /meta-analysis-results | -*PostApi* | [**neurovault_collections_post**](docs/PostApi.md#neurovault_collections_post) | **POST** /neurovault-collections | Create neurovault collection -*PostApi* | [**neurovault_files_post**](docs/PostApi.md#neurovault_files_post) | **POST** /neurovault-files | *PostApi* | [**projects_post**](docs/PostApi.md#projects_post) | **POST** /projects | *PostApi* | [**specifications_post**](docs/PostApi.md#specifications_post) | **POST** /specifications | Create a Specification *PostApi* | [**studysets_post**](docs/PostApi.md#studysets_post) | **POST** /studysets | Create a new Studyset @@ -177,8 +151,6 @@ Class | Method | HTTP request | Description *PutApi* | [**annotations_id_put**](docs/PutApi.md#annotations_id_put) | **PUT** /annotations/{id} | Update an Annotation *PutApi* | [**meta_analyses_id_put**](docs/PutApi.md#meta_analyses_id_put) | **PUT** /meta-analyses/{id} | Update a meta-analysis *PutApi* | [**meta_analysis_results_id_put**](docs/PutApi.md#meta_analysis_results_id_put) | **PUT** /meta-analysis-results/{id} | -*PutApi* | [**neurovault_collections_id_put**](docs/PutApi.md#neurovault_collections_id_put) | **PUT** /neurovault-collections/{id} | -*PutApi* | [**neurovault_files_id_put**](docs/PutApi.md#neurovault_files_id_put) | **PUT** /neurovault-files/{id} | *PutApi* | [**projects_id_put**](docs/PutApi.md#projects_id_put) | **PUT** /projects/{id} | *PutApi* | [**specifications_id_put**](docs/PutApi.md#specifications_id_put) | **PUT** /specifications/{id} | Update Meta-Analysis specification *PutApi* | [**studysets_id_put**](docs/PutApi.md#studysets_id_put) | **PUT** /studysets/{id} | Update a Studyset @@ -203,7 +175,6 @@ Class | Method | HTTP request | Description - [AnnotationPostBody](docs/AnnotationPostBody.md) - [AnnotationReturn](docs/AnnotationReturn.md) - [AnnotationUpdate](docs/AnnotationUpdate.md) - - [AnnotationUpdateAllOf](docs/AnnotationUpdateAllOf.md) - [Corrector](docs/Corrector.md) - [Estimator](docs/Estimator.md) - [MetaAnalysesGet400Response](docs/MetaAnalysesGet400Response.md) diff --git a/docs/Annotation.md b/docs/Annotation.md index 5102ab0..e6bae4f 100644 --- a/docs/Annotation.md +++ b/docs/Annotation.md @@ -3,6 +3,7 @@ a holder/reference to the annotation on neurostore ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | the id of the annotation on neurostore | [optional] @@ -20,12 +21,12 @@ json = "{}" # create an instance of Annotation from a JSON string annotation_instance = Annotation.from_json(json) # print the JSON string representation of the object -print Annotation.to_json() +print(Annotation.to_json()) # convert the object into a dict annotation_dict = annotation_instance.to_dict() # create an instance of Annotation from a dict -annotation_form_dict = annotation.from_dict(annotation_dict) +annotation_from_dict = Annotation.from_dict(annotation_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 57479cf..bf8af59 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/AnnotationPostBody.md b/docs/AnnotationPostBody.md index 4a9edf6..46f0012 100644 --- a/docs/AnnotationPostBody.md +++ b/docs/AnnotationPostBody.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cached_studyset_id** | **str** | | @@ -20,12 +21,12 @@ json = "{}" # create an instance of AnnotationPostBody from a JSON string annotation_post_body_instance = AnnotationPostBody.from_json(json) # print the JSON string representation of the object -print AnnotationPostBody.to_json() +print(AnnotationPostBody.to_json()) # convert the object into a dict annotation_post_body_dict = annotation_post_body_instance.to_dict() # create an instance of AnnotationPostBody from a dict -annotation_post_body_form_dict = annotation_post_body.from_dict(annotation_post_body_dict) +annotation_post_body_from_dict = AnnotationPostBody.from_dict(annotation_post_body_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 361f82c..e50b16c 100644 --- a/docs/AnnotationReturn.md +++ b/docs/AnnotationReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | the id of the annotation on neurostore | [optional] @@ -24,12 +25,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/AnnotationUpdate.md b/docs/AnnotationUpdate.md index bf28ae9..4890bed 100644 --- a/docs/AnnotationUpdate.md +++ b/docs/AnnotationUpdate.md @@ -2,13 +2,14 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cached_studyset_id** | **str** | | [optional] **neurostore_id** | **str** | the id of the annotation on neurostore | [optional] **snapshot** | **object** | the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm | [optional] **studyset** | **str** | The related cached studyset to this annotation. | [optional] [readonly] **neurostore_url** | **str** | | [optional] [readonly] +**cached_studyset_id** | **str** | | [optional] ## Example @@ -20,12 +21,12 @@ json = "{}" # create an instance of AnnotationUpdate from a JSON string annotation_update_instance = AnnotationUpdate.from_json(json) # print the JSON string representation of the object -print AnnotationUpdate.to_json() +print(AnnotationUpdate.to_json()) # convert the object into a dict annotation_update_dict = annotation_update_instance.to_dict() # create an instance of AnnotationUpdate from a dict -annotation_update_form_dict = annotation_update.from_dict(annotation_update_dict) +annotation_update_from_dict = AnnotationUpdate.from_dict(annotation_update_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 359589a..e38ba5d 100644 --- a/docs/AnnotationsApi.md +++ b/docs/AnnotationsApi.md @@ -19,9 +19,8 @@ get a list of serialized/referenced annotations ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_list import AnnotationList from neurosynth_compose_sdk.rest import ApiException @@ -49,7 +48,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -66,6 +67,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -82,9 +84,8 @@ get a single annotation ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.rest import ApiException @@ -113,8 +114,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -133,6 +136,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -151,9 +155,8 @@ update an existing annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate @@ -193,8 +196,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -214,6 +219,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -234,9 +240,8 @@ create a new serialized/referenced annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn @@ -275,8 +280,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **annotation_post_body** | [**AnnotationPostBody**](AnnotationPostBody.md)| | [optional] @@ -295,6 +302,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/ComposeApi.md b/docs/ComposeApi.md index 81817fb..5e768d7 100644 --- a/docs/ComposeApi.md +++ b/docs/ComposeApi.md @@ -16,14 +16,6 @@ Method | HTTP request | Description [**meta_analysis_results_id_get**](ComposeApi.md#meta_analysis_results_id_get) | **GET** /meta-analysis-results/{id} | Your GET endpoint [**meta_analysis_results_id_put**](ComposeApi.md#meta_analysis_results_id_put) | **PUT** /meta-analysis-results/{id} | [**meta_analysis_results_post**](ComposeApi.md#meta_analysis_results_post) | **POST** /meta-analysis-results | -[**neurovault_collections_get**](ComposeApi.md#neurovault_collections_get) | **GET** /neurovault-collections | Get neurovault collections -[**neurovault_collections_id_get**](ComposeApi.md#neurovault_collections_id_get) | **GET** /neurovault-collections/{id} | Your GET endpoint -[**neurovault_collections_id_put**](ComposeApi.md#neurovault_collections_id_put) | **PUT** /neurovault-collections/{id} | -[**neurovault_collections_post**](ComposeApi.md#neurovault_collections_post) | **POST** /neurovault-collections | Create neurovault collection -[**neurovault_files_get**](ComposeApi.md#neurovault_files_get) | **GET** /neurovault-files | Your GET endpoint -[**neurovault_files_id_get**](ComposeApi.md#neurovault_files_id_get) | **GET** /neurovault-files/{id} | Your GET endpoint -[**neurovault_files_id_put**](ComposeApi.md#neurovault_files_id_put) | **PUT** /neurovault-files/{id} | -[**neurovault_files_post**](ComposeApi.md#neurovault_files_post) | **POST** /neurovault-files | [**projects_get**](ComposeApi.md#projects_get) | **GET** /projects | Your GET endpoint [**projects_id_delete**](ComposeApi.md#projects_id_delete) | **DELETE** /projects/{id} | [**projects_id_get**](ComposeApi.md#projects_id_get) | **GET** /projects/{id} | Your GET endpoint @@ -48,9 +40,8 @@ get a list of serialized/referenced annotations ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_list import AnnotationList from neurosynth_compose_sdk.rest import ApiException @@ -78,7 +69,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -95,6 +88,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -111,9 +105,8 @@ get a single annotation ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.rest import ApiException @@ -142,8 +135,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -162,6 +157,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -180,9 +176,8 @@ update an existing annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate @@ -222,8 +217,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -243,6 +240,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -263,9 +261,8 @@ create a new serialized/referenced annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn @@ -304,656 +301,51 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **annotation_post_body** | [**AnnotationPostBody**](AnnotationPostBody.md)| | [optional] - -### Return type - -[**AnnotationReturn**](AnnotationReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/problem+json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | form when a request goes wrong | - | -**422** | form when a request goes wrong | - | -**500** | form when a request goes wrong | - | - -[[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) - -# **meta_analyses_get** -> MetaAnalysisList meta_analyses_get(nested=nested, ids=ids, page=page, page_size=page_size, name=name, search=search, description=description, sort=sort, desc=desc) - -GET a list of meta-analyses - -list all runnable specification, studyset, annotation bundles - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - nested = True # bool | show nested component instead of id (optional) - ids = ['ids_example'] # List[str] | choose the specific ids you wish to get (optional) - page = 56 # int | page of results (optional) - page_size = 56 # int | number of elements to return on a page (optional) - name = 'name_example' # str | search the name field for a term (optional) - search = 'imagin' # str | search for entries that contain the substring (optional) - description = 'description_example' # str | search description field for a term (optional) - sort = 'created_at' # str | Parameter to sort results on (optional) (default to 'created_at') - desc = True # bool | sort results by descending order (as opposed to ascending order) (optional) - - try: - # GET a list of meta-analyses - api_response = api_instance.meta_analyses_get(nested=nested, ids=ids, page=page, page_size=page_size, name=name, search=search, description=description, sort=sort, desc=desc) - print("The response of ComposeApi->meta_analyses_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analyses_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **nested** | **bool**| show nested component instead of id | [optional] - **ids** | [**List[str]**](str.md)| choose the specific ids you wish to get | [optional] - **page** | **int**| page of results | [optional] - **page_size** | **int**| number of elements to return on a page | [optional] - **name** | **str**| search the name field for a term | [optional] - **search** | **str**| search for entries that contain the substring | [optional] - **description** | **str**| search description field for a term | [optional] - **sort** | **str**| Parameter to sort results on | [optional] [default to 'created_at'] - **desc** | **bool**| sort results by descending order (as opposed to ascending order) | [optional] - -### Return type - -[**MetaAnalysisList**](MetaAnalysisList.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/problem+json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | form when a request goes wrong | - | - -[[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) - -# **meta_analyses_id_get** -> MetaAnalysisReturn meta_analyses_id_get(id, nested=nested) - -GET meta-analysis information - -get a meta-analysis (specification, annotation, and studyset) - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - id = 'id_example' # str | - nested = True # bool | show nested component instead of id (optional) - - try: - # GET meta-analysis information - api_response = api_instance.meta_analyses_id_get(id, nested=nested) - print("The response of ComposeApi->meta_analyses_id_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analyses_id_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **nested** | **bool**| show nested component instead of id | [optional] - -### Return type - -[**MetaAnalysisReturn**](MetaAnalysisReturn.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/problem+json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**401** | form when a request goes wrong | - | -**404** | form when a request goes wrong | - | - -[[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) - -# **meta_analyses_id_put** -> MetaAnalysisReturn meta_analyses_id_put(id, meta_analysis=meta_analysis) - -Update a meta-analysis - -update an existing meta-analysis (that has not yet been run) - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis -from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - id = 'id_example' # str | - meta_analysis = neurosynth_compose_sdk.MetaAnalysis() # MetaAnalysis | (optional) - - try: - # Update a meta-analysis - api_response = api_instance.meta_analyses_id_put(id, meta_analysis=meta_analysis) - print("The response of ComposeApi->meta_analyses_id_put:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analyses_id_put: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **meta_analysis** | [**MetaAnalysis**](MetaAnalysis.md)| | [optional] - -### Return type - -[**MetaAnalysisReturn**](MetaAnalysisReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/problem+json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | form when a request goes wrong | - | -**401** | form when a request goes wrong | - | -**404** | form when a request goes wrong | - | -**422** | form when a request goes wrong | - | - -[[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) - -# **meta_analyses_post** -> MetaAnalysisReturn meta_analyses_post(meta_analysis_post_body=meta_analysis_post_body) - -Create a new meta-analysis - -create a new specification, studyset, annotation bundle - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody -from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - meta_analysis_post_body = neurosynth_compose_sdk.MetaAnalysisPostBody() # MetaAnalysisPostBody | (optional) - - try: - # Create a new meta-analysis - api_response = api_instance.meta_analyses_post(meta_analysis_post_body=meta_analysis_post_body) - print("The response of ComposeApi->meta_analyses_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analyses_post: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **meta_analysis_post_body** | [**MetaAnalysisPostBody**](MetaAnalysisPostBody.md)| | [optional] - -### Return type - -[**MetaAnalysisReturn**](MetaAnalysisReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/problem+json - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | OK | - | -**400** | form when a request goes wrong | - | -**422** | form when a request goes wrong | - | -**500** | form when a request goes wrong | - | - -[[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) - -# **meta_analysis_results_get** -> ResultList meta_analysis_results_get(meta_analysis_id=meta_analysis_id) - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.result_list import ResultList -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - meta_analysis_id = 'meta_analysis_id_example' # str | search for results with this meta-analysis id (optional) - - try: - # Your GET endpoint - api_response = api_instance.meta_analysis_results_get(meta_analysis_id=meta_analysis_id) - print("The response of ComposeApi->meta_analysis_results_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analysis_results_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **meta_analysis_id** | **str**| search for results with this meta-analysis id | [optional] - -### Return type - -[**ResultList**](ResultList.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) - -# **meta_analysis_results_id_get** -> ResultReturn meta_analysis_results_id_get(id) - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.result_return import ResultReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - id = 'id_example' # str | - - try: - # Your GET endpoint - api_response = api_instance.meta_analysis_results_id_get(id) - print("The response of ComposeApi->meta_analysis_results_id_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analysis_results_id_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - -### Return type - -[**ResultReturn**](ResultReturn.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) - -# **meta_analysis_results_id_put** -> ResultReturn meta_analysis_results_id_put(id, result=result) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -* Api Key Authentication (upload_key): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.result import Result -from neurosynth_compose_sdk.models.result_return import ResultReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Configure API key authorization: upload_key -configuration.api_key['upload_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['upload_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - id = 'id_example' # str | - result = neurosynth_compose_sdk.Result() # Result | (optional) - - try: - # - api_response = api_instance.meta_analysis_results_id_put(id, result=result) - print("The response of ComposeApi->meta_analysis_results_id_put:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analysis_results_id_put: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **result** | [**Result**](Result.md)| | [optional] - -### Return type - -[**ResultReturn**](ResultReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token), [upload_key](../README.md#upload_key) - -### HTTP request headers - - - **Content-Type**: application/json, multipart/form-data - - **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) - -# **meta_analysis_results_post** -> ResultReturn meta_analysis_results_post(result_init=result_init) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -* Api Key Authentication (upload_key): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.result_init import ResultInit -from neurosynth_compose_sdk.models.result_return import ResultReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Configure API key authorization: upload_key -configuration.api_key['upload_key'] = os.environ["API_KEY"] - -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['upload_key'] = 'Bearer' - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - result_init = neurosynth_compose_sdk.ResultInit() # ResultInit | (optional) - - try: - # - api_response = api_instance.meta_analysis_results_post(result_init=result_init) - print("The response of ComposeApi->meta_analysis_results_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ComposeApi->meta_analysis_results_post: %s\n" % e) -``` - ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **result_init** | [**ResultInit**](ResultInit.md)| | [optional] + **annotation_post_body** | [**AnnotationPostBody**](AnnotationPostBody.md)| | [optional] ### Return type -[**ResultReturn**](ResultReturn.md) +[**AnnotationReturn**](AnnotationReturn.md) ### Authorization -[JSON-Web-Token](../README.md#JSON-Web-Token), [upload_key](../README.md#upload_key) +[JSON-Web-Token](../README.md#JSON-Web-Token) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | form when a request goes wrong | - | +**422** | form when a request goes wrong | - | +**500** | form when a request goes wrong | - | [[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) -# **neurovault_collections_get** -> neurovault_collections_get() +# **meta_analyses_get** +> MetaAnalysisList meta_analyses_get(nested=nested, ids=ids, page=page, page_size=page_size, name=name, search=search, description=description, sort=sort, desc=desc) + +GET a list of meta-analyses -Get neurovault collections +list all runnable specification, studyset, annotation bundles ### Example + ```python -import time -import os import neurosynth_compose_sdk +from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -968,21 +360,45 @@ configuration = neurosynth_compose_sdk.Configuration( with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) + nested = True # bool | show nested component instead of id (optional) + ids = ['ids_example'] # List[str] | choose the specific ids you wish to get (optional) + page = 56 # int | page of results (optional) + page_size = 56 # int | number of elements to return on a page (optional) + name = 'name_example' # str | search the name field for a term (optional) + search = 'imagin' # str | search for entries that contain the substring (optional) + description = 'description_example' # str | search description field for a term (optional) + sort = 'created_at' # str | Parameter to sort results on (optional) (default to 'created_at') + desc = True # bool | sort results by descending order (as opposed to ascending order) (optional) try: - # Get neurovault collections - api_instance.neurovault_collections_get() + # GET a list of meta-analyses + api_response = api_instance.meta_analyses_get(nested=nested, ids=ids, page=page, page_size=page_size, name=name, search=search, description=description, sort=sort, desc=desc) + print("The response of ComposeApi->meta_analyses_get:\n") + pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_collections_get: %s\n" % e) + print("Exception when calling ComposeApi->meta_analyses_get: %s\n" % e) ``` + ### Parameters -This endpoint does not need any parameter. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **nested** | **bool**| show nested component instead of id | [optional] + **ids** | [**List[str]**](str.md)| choose the specific ids you wish to get | [optional] + **page** | **int**| page of results | [optional] + **page_size** | **int**| number of elements to return on a page | [optional] + **name** | **str**| search the name field for a term | [optional] + **search** | **str**| search for entries that contain the substring | [optional] + **description** | **str**| search description field for a term | [optional] + **sort** | **str**| Parameter to sort results on | [optional] [default to 'created_at'] + **desc** | **bool**| sort results by descending order (as opposed to ascending order) | [optional] ### Return type -void (empty response body) +[**MetaAnalysisList**](MetaAnalysisList.md) ### Authorization @@ -991,27 +407,30 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: Not defined + - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | form when a request goes wrong | - | [[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) -# **neurovault_collections_id_get** -> NeurovaultCollectionReturn neurovault_collections_id_get(id) +# **meta_analyses_id_get** +> MetaAnalysisReturn meta_analyses_id_get(id, nested=nested) + +GET meta-analysis information -Your GET endpoint +get a meta-analysis (specification, annotation, and studyset) ### Example + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn +from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1027,26 +446,30 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) id = 'id_example' # str | + nested = True # bool | show nested component instead of id (optional) try: - # Your GET endpoint - api_response = api_instance.neurovault_collections_id_get(id) - print("The response of ComposeApi->neurovault_collections_id_get:\n") + # GET meta-analysis information + api_response = api_instance.meta_analyses_id_get(id, nested=nested) + print("The response of ComposeApi->meta_analyses_id_get:\n") pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_collections_id_get: %s\n" % e) + print("Exception when calling ComposeApi->meta_analyses_id_get: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | + **nested** | **bool**| show nested component instead of id | [optional] ### Return type -[**NeurovaultCollectionReturn**](NeurovaultCollectionReturn.md) +[**MetaAnalysisReturn**](MetaAnalysisReturn.md) ### Authorization @@ -1055,28 +478,33 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json + - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**401** | form when a request goes wrong | - | +**404** | form when a request goes wrong | - | [[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) -# **neurovault_collections_id_put** -> NeurovaultCollectionReturn neurovault_collections_id_put(id) +# **meta_analyses_id_put** +> MetaAnalysisReturn meta_analyses_id_put(id, meta_analysis=meta_analysis) +Update a meta-analysis +update an existing meta-analysis (that has not yet been run) ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn +from neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis +from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1101,26 +529,30 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) id = 'id_example' # str | + meta_analysis = neurosynth_compose_sdk.MetaAnalysis() # MetaAnalysis | (optional) try: - # - api_response = api_instance.neurovault_collections_id_put(id) - print("The response of ComposeApi->neurovault_collections_id_put:\n") + # Update a meta-analysis + api_response = api_instance.meta_analyses_id_put(id, meta_analysis=meta_analysis) + print("The response of ComposeApi->meta_analyses_id_put:\n") pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_collections_id_put: %s\n" % e) + print("Exception when calling ComposeApi->meta_analyses_id_put: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | + **meta_analysis** | [**MetaAnalysis**](MetaAnalysis.md)| | [optional] ### Return type -[**NeurovaultCollectionReturn**](NeurovaultCollectionReturn.md) +[**MetaAnalysisReturn**](MetaAnalysisReturn.md) ### Authorization @@ -1128,31 +560,36 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json + - **Content-Type**: application/json + - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | form when a request goes wrong | - | +**401** | form when a request goes wrong | - | +**404** | form when a request goes wrong | - | +**422** | form when a request goes wrong | - | [[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) -# **neurovault_collections_post** -> neurovault_collections_post(neurovault_collection=neurovault_collection) - -Create neurovault collection +# **meta_analyses_post** +> MetaAnalysisReturn meta_analyses_post(meta_analysis_post_body=meta_analysis_post_body) +Create a new meta-analysis +create a new specification, studyset, annotation bundle ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_collection import NeurovaultCollection +from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody +from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1176,25 +613,29 @@ configuration = neurosynth_compose_sdk.Configuration( with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - neurovault_collection = neurosynth_compose_sdk.NeurovaultCollection() # NeurovaultCollection | (optional) + meta_analysis_post_body = neurosynth_compose_sdk.MetaAnalysisPostBody() # MetaAnalysisPostBody | (optional) try: - # Create neurovault collection - api_instance.neurovault_collections_post(neurovault_collection=neurovault_collection) + # Create a new meta-analysis + api_response = api_instance.meta_analyses_post(meta_analysis_post_body=meta_analysis_post_body) + print("The response of ComposeApi->meta_analyses_post:\n") + pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_collections_post: %s\n" % e) + print("Exception when calling ComposeApi->meta_analyses_post: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **neurovault_collection** | [**NeurovaultCollection**](NeurovaultCollection.md)| | [optional] + **meta_analysis_post_body** | [**MetaAnalysisPostBody**](MetaAnalysisPostBody.md)| | [optional] ### Return type -void (empty response body) +[**MetaAnalysisReturn**](MetaAnalysisReturn.md) ### Authorization @@ -1203,27 +644,30 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: Not defined + - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | +**400** | form when a request goes wrong | - | +**422** | form when a request goes wrong | - | +**500** | form when a request goes wrong | - | [[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) -# **neurovault_files_get** -> NeurovaultFileList neurovault_files_get() +# **meta_analysis_results_get** +> ResultList meta_analysis_results_get(meta_analysis_id=meta_analysis_id) Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file_list import NeurovaultFileList +from neurosynth_compose_sdk.models.result_list import ResultList from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1238,23 +682,29 @@ configuration = neurosynth_compose_sdk.Configuration( with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) + meta_analysis_id = 'meta_analysis_id_example' # str | search for results with this meta-analysis id (optional) try: # Your GET endpoint - api_response = api_instance.neurovault_files_get() - print("The response of ComposeApi->neurovault_files_get:\n") + api_response = api_instance.meta_analysis_results_get(meta_analysis_id=meta_analysis_id) + print("The response of ComposeApi->meta_analysis_results_get:\n") pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_files_get: %s\n" % e) + print("Exception when calling ComposeApi->meta_analysis_results_get: %s\n" % e) ``` + ### Parameters -This endpoint does not need any parameter. + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **meta_analysis_id** | **str**| search for results with this meta-analysis id | [optional] ### Return type -[**NeurovaultFileList**](NeurovaultFileList.md) +[**ResultList**](ResultList.md) ### Authorization @@ -1266,24 +716,24 @@ No authorization required - **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) -# **neurovault_files_id_get** -> NeurovaultFileReturn neurovault_files_id_get(id) +# **meta_analysis_results_id_get** +> ResultReturn meta_analysis_results_id_get(id) Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn +from neurosynth_compose_sdk.models.result_return import ResultReturn from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1302,23 +752,25 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: try: # Your GET endpoint - api_response = api_instance.neurovault_files_id_get(id) - print("The response of ComposeApi->neurovault_files_id_get:\n") + api_response = api_instance.meta_analysis_results_id_get(id) + print("The response of ComposeApi->meta_analysis_results_id_get:\n") pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_files_id_get: %s\n" % e) + print("Exception when calling ComposeApi->meta_analysis_results_id_get: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | ### Return type -[**NeurovaultFileReturn**](NeurovaultFileReturn.md) +[**ResultReturn**](ResultReturn.md) ### Authorization @@ -1330,25 +782,27 @@ No authorization required - **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) -# **neurovault_files_id_put** -> NeurovaultFileReturn neurovault_files_id_put(id, collection_id=collection_id, exception=exception, traceback=traceback, status=status, image_id=image_id, name=name, url=url) +# **meta_analysis_results_id_put** +> ResultReturn meta_analysis_results_id_put(id, result=result) ### Example * Bearer Authentication (JSON-Web-Token): +* Api Key Authentication (upload_key): + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn +from neurosynth_compose_sdk.models.result import Result +from neurosynth_compose_sdk.models.result_return import ResultReturn from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1368,76 +822,73 @@ configuration = neurosynth_compose_sdk.Configuration( access_token = os.environ["BEARER_TOKEN"] ) +# Configure API key authorization: upload_key +configuration.api_key['upload_key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['upload_key'] = 'Bearer' + # Enter a context with an instance of the API client with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) id = 'id_example' # str | - collection_id = 'collection_id_example' # str | (optional) - exception = 'exception_example' # str | (optional) - traceback = 'traceback_example' # str | (optional) - status = 'status_example' # str | (optional) - image_id = 'image_id_example' # str | (optional) - name = 'name_example' # str | (optional) - url = 'url_example' # str | (optional) + result = neurosynth_compose_sdk.Result() # Result | (optional) try: # - api_response = api_instance.neurovault_files_id_put(id, collection_id=collection_id, exception=exception, traceback=traceback, status=status, image_id=image_id, name=name, url=url) - print("The response of ComposeApi->neurovault_files_id_put:\n") + api_response = api_instance.meta_analysis_results_id_put(id, result=result) + print("The response of ComposeApi->meta_analysis_results_id_put:\n") pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_files_id_put: %s\n" % e) + print("Exception when calling ComposeApi->meta_analysis_results_id_put: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | - **collection_id** | **str**| | [optional] - **exception** | **str**| | [optional] - **traceback** | **str**| | [optional] - **status** | **str**| | [optional] - **image_id** | **str**| | [optional] - **name** | **str**| | [optional] - **url** | **str**| | [optional] + **result** | [**Result**](Result.md)| | [optional] ### Return type -[**NeurovaultFileReturn**](NeurovaultFileReturn.md) +[**ResultReturn**](ResultReturn.md) ### Authorization -[JSON-Web-Token](../README.md#JSON-Web-Token) +[JSON-Web-Token](../README.md#JSON-Web-Token), [upload_key](../README.md#upload_key) ### HTTP request headers - - **Content-Type**: multipart/form-data + - **Content-Type**: application/json, multipart/form-data - **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) -# **neurovault_files_post** -> NeurovaultFileReturn neurovault_files_post(neurovault_file=neurovault_file) +# **meta_analysis_results_post** +> ResultReturn meta_analysis_results_post(result_init=result_init) ### Example * Bearer Authentication (JSON-Web-Token): +* Api Key Authentication (upload_key): + ```python -import time -import os import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file import NeurovaultFile -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn +from neurosynth_compose_sdk.models.result_init import ResultInit +from neurosynth_compose_sdk.models.result_return import ResultReturn from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1457,35 +908,43 @@ configuration = neurosynth_compose_sdk.Configuration( access_token = os.environ["BEARER_TOKEN"] ) +# Configure API key authorization: upload_key +configuration.api_key['upload_key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['upload_key'] = 'Bearer' + # Enter a context with an instance of the API client with neurosynth_compose_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = neurosynth_compose_sdk.ComposeApi(api_client) - neurovault_file = neurosynth_compose_sdk.NeurovaultFile() # NeurovaultFile | (optional) + result_init = neurosynth_compose_sdk.ResultInit() # ResultInit | (optional) try: # - api_response = api_instance.neurovault_files_post(neurovault_file=neurovault_file) - print("The response of ComposeApi->neurovault_files_post:\n") + api_response = api_instance.meta_analysis_results_post(result_init=result_init) + print("The response of ComposeApi->meta_analysis_results_post:\n") pprint(api_response) except Exception as e: - print("Exception when calling ComposeApi->neurovault_files_post: %s\n" % e) + print("Exception when calling ComposeApi->meta_analysis_results_post: %s\n" % e) ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **neurovault_file** | [**NeurovaultFile**](NeurovaultFile.md)| | [optional] + **result_init** | [**ResultInit**](ResultInit.md)| | [optional] ### Return type -[**NeurovaultFileReturn**](NeurovaultFileReturn.md) +[**ResultReturn**](ResultReturn.md) ### Authorization -[JSON-Web-Token](../README.md#JSON-Web-Token) +[JSON-Web-Token](../README.md#JSON-Web-Token), [upload_key](../README.md#upload_key) ### HTTP request headers @@ -1493,6 +952,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1507,9 +967,8 @@ Your GET endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project_list import ProjectList from neurosynth_compose_sdk.rest import ApiException @@ -1554,8 +1013,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| page of results | [optional] @@ -1581,6 +1042,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1595,9 +1057,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -1632,8 +1093,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1652,6 +1115,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1665,9 +1129,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project_return import ProjectReturn from neurosynth_compose_sdk.rest import ApiException @@ -1697,8 +1160,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1718,6 +1183,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1732,9 +1198,8 @@ No authorization required ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -1774,8 +1239,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1795,6 +1262,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1809,9 +1277,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -1850,8 +1317,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project** | [**Project**](Project.md)| | [optional] @@ -1870,6 +1339,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1885,9 +1355,8 @@ list of meta-analysis specifications ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_list import SpecificationList from neurosynth_compose_sdk.rest import ApiException @@ -1915,7 +1384,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -1932,6 +1403,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1948,9 +1420,8 @@ get a meta-analysis specification ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_return import SpecificationReturn from neurosynth_compose_sdk.rest import ApiException @@ -1979,8 +1450,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1999,6 +1472,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2017,9 +1491,8 @@ update an existing meta analysis specification ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification import Specification from neurosynth_compose_sdk.models.specification_return import SpecificationReturn @@ -2059,8 +1532,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2080,6 +1555,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2100,9 +1576,8 @@ create a new meta-analysis specification ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_post_body import SpecificationPostBody from neurosynth_compose_sdk.models.specification_return import SpecificationReturn @@ -2141,8 +1616,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **specification_post_body** | [**SpecificationPostBody**](SpecificationPostBody.md)| | [optional] @@ -2161,6 +1638,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2179,9 +1657,8 @@ get a list of serialized/referenced studysets ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_list import StudysetList from neurosynth_compose_sdk.rest import ApiException @@ -2209,7 +1686,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -2226,6 +1705,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2242,9 +1722,8 @@ get a single serialized/referenced studyset ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_return import StudysetReturn from neurosynth_compose_sdk.rest import ApiException @@ -2273,8 +1752,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2293,6 +1774,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2311,9 +1793,8 @@ update an existing serialized/referenced studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset import Studyset from neurosynth_compose_sdk.models.studyset_return import StudysetReturn @@ -2353,8 +1834,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -2374,6 +1857,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -2394,9 +1878,8 @@ create a new serialized/referenced studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_post_body import StudysetPostBody from neurosynth_compose_sdk.models.studyset_return import StudysetReturn @@ -2435,8 +1918,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_post_body** | [**StudysetPostBody**](StudysetPostBody.md)| | [optional] @@ -2455,6 +1940,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/Corrector.md b/docs/Corrector.md index 4982eaf..6d220b4 100644 --- a/docs/Corrector.md +++ b/docs/Corrector.md @@ -3,6 +3,7 @@ The function/class applying statistical adjustments to the output of the meta-analysis (optional). ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | the name of the function/class performing the correction. For example FWECorrector from NiMARE would be valid. | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of Corrector from a JSON string corrector_instance = Corrector.from_json(json) # print the JSON string representation of the object -print Corrector.to_json() +print(Corrector.to_json()) # convert the object into a dict corrector_dict = corrector_instance.to_dict() # create an instance of Corrector from a dict -corrector_form_dict = corrector.from_dict(corrector_dict) +corrector_from_dict = Corrector.from_dict(corrector_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/DefaultApi.md b/docs/DefaultApi.md index e4bc61f..3b91daa 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -5,10 +5,6 @@ All URIs are relative to *https://compose.neurosynth.org/api* Method | HTTP request | Description ------------- | ------------- | ------------- [**meta_analyses_id_delete**](DefaultApi.md#meta_analyses_id_delete) | **DELETE** /meta-analyses/{id} | -[**neurostore_studies_get**](DefaultApi.md#neurostore_studies_get) | **GET** /neurostore-studies | Your GET endpoint -[**neurostore_studies_id_get**](DefaultApi.md#neurostore_studies_id_get) | **GET** /neurostore-studies/{id} | Your GET endpoint -[**neurostore_studies_id_put**](DefaultApi.md#neurostore_studies_id_put) | **PUT** /neurostore-studies/{id} | -[**neurostore_studies_post**](DefaultApi.md#neurostore_studies_post) | **POST** /neurostore-studies | [**studyset_references_get**](DefaultApi.md#studyset_references_get) | **GET** /studyset-references | Your GET endpoint [**studyset_references_id_get**](DefaultApi.md#studyset_references_id_get) | **GET** /studyset-references/{id} | Your GET endpoint @@ -21,9 +17,8 @@ Method | HTTP request | Description ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -58,8 +53,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -78,274 +75,7 @@ void (empty response body) - **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) - -# **neurostore_studies_get** -> NeurostoreStudyList neurostore_studies_get() - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurostore_study_list import NeurostoreStudyList -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.DefaultApi(api_client) - - try: - # Your GET endpoint - api_response = api_instance.neurostore_studies_get() - print("The response of DefaultApi->neurostore_studies_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->neurostore_studies_get: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**NeurostoreStudyList**](NeurostoreStudyList.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) - -# **neurostore_studies_id_get** -> NeurostoreStudyReturn neurostore_studies_id_get(id) - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurostore_study_return import NeurostoreStudyReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.DefaultApi(api_client) - id = 'id_example' # str | - - try: - # Your GET endpoint - api_response = api_instance.neurostore_studies_id_get(id) - print("The response of DefaultApi->neurostore_studies_id_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->neurostore_studies_id_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - -### Return type - -[**NeurostoreStudyReturn**](NeurostoreStudyReturn.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) - -# **neurostore_studies_id_put** -> NeurostoreStudyReturn neurostore_studies_id_put(id) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurostore_study_return import NeurostoreStudyReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.DefaultApi(api_client) - id = 'id_example' # str | - - try: - # - api_response = api_instance.neurostore_studies_id_put(id) - print("The response of DefaultApi->neurostore_studies_id_put:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->neurostore_studies_id_put: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - -### Return type - -[**NeurostoreStudyReturn**](NeurostoreStudyReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **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) - -# **neurostore_studies_post** -> NeurostoreStudyReturn neurostore_studies_post() - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurostore_study_return import NeurostoreStudyReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.DefaultApi(api_client) - - try: - # - api_response = api_instance.neurostore_studies_post() - print("The response of DefaultApi->neurostore_studies_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DefaultApi->neurostore_studies_post: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**NeurostoreStudyReturn**](NeurostoreStudyReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -361,9 +91,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_reference_list import StudysetReferenceList from neurosynth_compose_sdk.rest import ApiException @@ -392,8 +121,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **nested** | **bool**| show nested component instead of id | [optional] @@ -412,6 +143,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -425,9 +157,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_reference_return import StudysetReferenceReturn from neurosynth_compose_sdk.rest import ApiException @@ -457,8 +188,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -478,6 +211,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/Estimator.md b/docs/Estimator.md index a46fa96..d0c1f3d 100644 --- a/docs/Estimator.md +++ b/docs/Estimator.md @@ -3,6 +3,7 @@ the specification for the function/class running the meta-analysis ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | the meta-analytic algorithm applied to the data. Currently this should be directly tied to the function/class running the meta-analysis. For example, ALE, or MKDADensity are valid NiMARE classes to put here. | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of Estimator from a JSON string estimator_instance = Estimator.from_json(json) # print the JSON string representation of the object -print Estimator.to_json() +print(Estimator.to_json()) # convert the object into a dict estimator_dict = estimator_instance.to_dict() # create an instance of Estimator from a dict -estimator_form_dict = estimator.from_dict(estimator_dict) +estimator_from_dict = Estimator.from_dict(estimator_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/GetApi.md b/docs/GetApi.md index 3510893..eb60864 100644 --- a/docs/GetApi.md +++ b/docs/GetApi.md @@ -10,10 +10,6 @@ Method | HTTP request | Description [**meta_analyses_id_get**](GetApi.md#meta_analyses_id_get) | **GET** /meta-analyses/{id} | GET meta-analysis information [**meta_analysis_results_get**](GetApi.md#meta_analysis_results_get) | **GET** /meta-analysis-results | Your GET endpoint [**meta_analysis_results_id_get**](GetApi.md#meta_analysis_results_id_get) | **GET** /meta-analysis-results/{id} | Your GET endpoint -[**neurovault_collections_get**](GetApi.md#neurovault_collections_get) | **GET** /neurovault-collections | Get neurovault collections -[**neurovault_collections_id_get**](GetApi.md#neurovault_collections_id_get) | **GET** /neurovault-collections/{id} | Your GET endpoint -[**neurovault_files_get**](GetApi.md#neurovault_files_get) | **GET** /neurovault-files | Your GET endpoint -[**neurovault_files_id_get**](GetApi.md#neurovault_files_id_get) | **GET** /neurovault-files/{id} | Your GET endpoint [**projects_get**](GetApi.md#projects_get) | **GET** /projects | Your GET endpoint [**projects_id_get**](GetApi.md#projects_id_get) | **GET** /projects/{id} | Your GET endpoint [**specifications_get**](GetApi.md#specifications_get) | **GET** /specifications | Get a list of Specifications @@ -31,9 +27,8 @@ get a list of serialized/referenced annotations ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_list import AnnotationList from neurosynth_compose_sdk.rest import ApiException @@ -61,7 +56,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -78,6 +75,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -94,9 +92,8 @@ get a single annotation ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.rest import ApiException @@ -125,8 +122,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -145,6 +144,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -162,9 +162,8 @@ list all runnable specification, studyset, annotation bundles ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList from neurosynth_compose_sdk.rest import ApiException @@ -201,8 +200,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **nested** | **bool**| show nested component instead of id | [optional] @@ -229,6 +230,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -245,9 +247,8 @@ get a meta-analysis (specification, annotation, and studyset) ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn from neurosynth_compose_sdk.rest import ApiException @@ -277,8 +278,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -298,6 +301,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -313,9 +317,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result_list import ResultList from neurosynth_compose_sdk.rest import ApiException @@ -344,8 +347,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **meta_analysis_id** | **str**| search for results with this meta-analysis id | [optional] @@ -364,6 +369,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -377,9 +383,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result_return import ResultReturn from neurosynth_compose_sdk.rest import ApiException @@ -408,128 +413,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - -### Return type - -[**ResultReturn**](ResultReturn.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) - -# **neurovault_collections_get** -> neurovault_collections_get() - -Get neurovault collections - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.GetApi(api_client) - - try: - # Get neurovault collections - api_instance.neurovault_collections_get() - except Exception as e: - print("Exception when calling GetApi->neurovault_collections_get: %s\n" % e) -``` - ### Parameters -This endpoint does not need any parameter. - -### 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 | -|-------------|-------------|------------------| -**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) -# **neurovault_collections_id_get** -> NeurovaultCollectionReturn neurovault_collections_id_get(id) - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.GetApi(api_client) - id = 'id_example' # str | - - try: - # Your GET endpoint - api_response = api_instance.neurovault_collections_id_get(id) - print("The response of GetApi->neurovault_collections_id_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling GetApi->neurovault_collections_id_get: %s\n" % e) -``` - - -### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -537,67 +423,7 @@ Name | Type | Description | Notes ### Return type -[**NeurovaultCollectionReturn**](NeurovaultCollectionReturn.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) - -# **neurovault_files_get** -> NeurovaultFileList neurovault_files_get() - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file_list import NeurovaultFileList -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.GetApi(api_client) - - try: - # Your GET endpoint - api_response = api_instance.neurovault_files_get() - print("The response of GetApi->neurovault_files_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling GetApi->neurovault_files_get: %s\n" % e) -``` - - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**NeurovaultFileList**](NeurovaultFileList.md) +[**ResultReturn**](ResultReturn.md) ### Authorization @@ -609,70 +435,7 @@ No authorization required - **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) - -# **neurovault_files_id_get** -> NeurovaultFileReturn neurovault_files_id_get(id) - -Your GET endpoint - -### Example - -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.org/api" -) - - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.GetApi(api_client) - id = 'id_example' # str | - - try: - # Your GET endpoint - api_response = api_instance.neurovault_files_id_get(id) - print("The response of GetApi->neurovault_files_id_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling GetApi->neurovault_files_id_get: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - -### Return type - -[**NeurovaultFileReturn**](NeurovaultFileReturn.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 | - | @@ -687,9 +450,8 @@ Your GET endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project_list import ProjectList from neurosynth_compose_sdk.rest import ApiException @@ -734,8 +496,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| page of results | [optional] @@ -761,6 +525,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -774,9 +539,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project_return import ProjectReturn from neurosynth_compose_sdk.rest import ApiException @@ -806,8 +570,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -827,6 +593,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -842,9 +609,8 @@ list of meta-analysis specifications ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_list import SpecificationList from neurosynth_compose_sdk.rest import ApiException @@ -872,7 +638,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -889,6 +657,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -905,9 +674,8 @@ get a meta-analysis specification ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_return import SpecificationReturn from neurosynth_compose_sdk.rest import ApiException @@ -936,8 +704,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -956,6 +726,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -973,9 +744,8 @@ get a list of serialized/referenced studysets ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_list import StudysetList from neurosynth_compose_sdk.rest import ApiException @@ -1003,7 +773,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -1020,6 +792,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -1036,9 +809,8 @@ get a single serialized/referenced studyset ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_return import StudysetReturn from neurosynth_compose_sdk.rest import ApiException @@ -1067,8 +839,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -1087,6 +861,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/MetaAnalysesApi.md b/docs/MetaAnalysesApi.md index 3551129..d9291b6 100644 --- a/docs/MetaAnalysesApi.md +++ b/docs/MetaAnalysesApi.md @@ -23,9 +23,8 @@ list all runnable specification, studyset, annotation bundles ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList from neurosynth_compose_sdk.rest import ApiException @@ -62,8 +61,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **nested** | **bool**| show nested component instead of id | [optional] @@ -90,6 +91,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -106,9 +108,8 @@ get a meta-analysis (specification, annotation, and studyset) ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn from neurosynth_compose_sdk.rest import ApiException @@ -138,8 +139,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -159,6 +162,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -177,9 +181,8 @@ update an existing meta-analysis (that has not yet been run) ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn @@ -219,8 +222,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -240,6 +245,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -260,9 +266,8 @@ create a new specification, studyset, annotation bundle ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn @@ -301,8 +306,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **meta_analysis_post_body** | [**MetaAnalysisPostBody**](MetaAnalysisPostBody.md)| | [optional] @@ -321,6 +328,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -337,9 +345,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result_list import ResultList from neurosynth_compose_sdk.rest import ApiException @@ -368,8 +375,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **meta_analysis_id** | **str**| search for results with this meta-analysis id | [optional] @@ -388,6 +397,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -401,9 +411,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result_return import ResultReturn from neurosynth_compose_sdk.rest import ApiException @@ -432,8 +441,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -452,6 +463,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -467,9 +479,8 @@ No authorization required * Bearer Authentication (JSON-Web-Token): * Api Key Authentication (upload_key): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result import Result from neurosynth_compose_sdk.models.result_return import ResultReturn @@ -515,8 +526,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -536,6 +549,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -551,9 +565,8 @@ Name | Type | Description | Notes * Bearer Authentication (JSON-Web-Token): * Api Key Authentication (upload_key): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result_init import ResultInit from neurosynth_compose_sdk.models.result_return import ResultReturn @@ -598,8 +611,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **result_init** | [**ResultInit**](ResultInit.md)| | [optional] @@ -618,6 +633,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/MetaAnalysesGet400Response.md b/docs/MetaAnalysesGet400Response.md index fcff769..d722855 100644 --- a/docs/MetaAnalysesGet400Response.md +++ b/docs/MetaAnalysesGet400Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **detail** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of MetaAnalysesGet400Response from a JSON string meta_analyses_get400_response_instance = MetaAnalysesGet400Response.from_json(json) # print the JSON string representation of the object -print MetaAnalysesGet400Response.to_json() +print(MetaAnalysesGet400Response.to_json()) # convert the object into a dict meta_analyses_get400_response_dict = meta_analyses_get400_response_instance.to_dict() # create an instance of MetaAnalysesGet400Response from a dict -meta_analyses_get400_response_form_dict = meta_analyses_get400_response.from_dict(meta_analyses_get400_response_dict) +meta_analyses_get400_response_from_dict = MetaAnalysesGet400Response.from_dict(meta_analyses_get400_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/MetaAnalysis.md b/docs/MetaAnalysis.md index 8307b91..b0dfd6d 100644 --- a/docs/MetaAnalysis.md +++ b/docs/MetaAnalysis.md @@ -3,6 +3,7 @@ The combination of the specification determining what meta-analysis to run (required), the studyset to act as input to the meta-analytic algorithm (required), and the annotation to provide human readable annotations as well as acts as an optional filter on which analyses to select within the studyset (optional, but suggested). ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **specification** | [**MetaAnalysisSpecification**](MetaAnalysisSpecification.md) | | [optional] @@ -35,12 +36,12 @@ json = "{}" # create an instance of MetaAnalysis from a JSON string meta_analysis_instance = MetaAnalysis.from_json(json) # print the JSON string representation of the object -print MetaAnalysis.to_json() +print(MetaAnalysis.to_json()) # convert the object into a dict meta_analysis_dict = meta_analysis_instance.to_dict() # create an instance of MetaAnalysis from a dict -meta_analysis_form_dict = meta_analysis.from_dict(meta_analysis_dict) +meta_analysis_from_dict = MetaAnalysis.from_dict(meta_analysis_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/MetaAnalysisAnnotation.md b/docs/MetaAnalysisAnnotation.md index 4926d98..31697e9 100644 --- a/docs/MetaAnalysisAnnotation.md +++ b/docs/MetaAnalysisAnnotation.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | the id of the annotation on neurostore | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of MetaAnalysisAnnotation from a JSON string meta_analysis_annotation_instance = MetaAnalysisAnnotation.from_json(json) # print the JSON string representation of the object -print MetaAnalysisAnnotation.to_json() +print(MetaAnalysisAnnotation.to_json()) # convert the object into a dict meta_analysis_annotation_dict = meta_analysis_annotation_instance.to_dict() # create an instance of MetaAnalysisAnnotation from a dict -meta_analysis_annotation_form_dict = meta_analysis_annotation.from_dict(meta_analysis_annotation_dict) +meta_analysis_annotation_from_dict = MetaAnalysisAnnotation.from_dict(meta_analysis_annotation_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/MetaAnalysisList.md b/docs/MetaAnalysisList.md index d48c7c7..38ad8f9 100644 --- a/docs/MetaAnalysisList.md +++ b/docs/MetaAnalysisList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[MetaAnalysisReturn]**](MetaAnalysisReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of MetaAnalysisList from a JSON string meta_analysis_list_instance = MetaAnalysisList.from_json(json) # print the JSON string representation of the object -print MetaAnalysisList.to_json() +print(MetaAnalysisList.to_json()) # convert the object into a dict meta_analysis_list_dict = meta_analysis_list_instance.to_dict() # create an instance of MetaAnalysisList from a dict -meta_analysis_list_form_dict = meta_analysis_list.from_dict(meta_analysis_list_dict) +meta_analysis_list_from_dict = MetaAnalysisList.from_dict(meta_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/MetaAnalysisPostBody.md b/docs/MetaAnalysisPostBody.md index d67e08f..068e244 100644 --- a/docs/MetaAnalysisPostBody.md +++ b/docs/MetaAnalysisPostBody.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **specification** | [**MetaAnalysisSpecification**](MetaAnalysisSpecification.md) | | @@ -34,12 +35,12 @@ json = "{}" # create an instance of MetaAnalysisPostBody from a JSON string meta_analysis_post_body_instance = MetaAnalysisPostBody.from_json(json) # print the JSON string representation of the object -print MetaAnalysisPostBody.to_json() +print(MetaAnalysisPostBody.to_json()) # convert the object into a dict meta_analysis_post_body_dict = meta_analysis_post_body_instance.to_dict() # create an instance of MetaAnalysisPostBody from a dict -meta_analysis_post_body_form_dict = meta_analysis_post_body.from_dict(meta_analysis_post_body_dict) +meta_analysis_post_body_from_dict = MetaAnalysisPostBody.from_dict(meta_analysis_post_body_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/MetaAnalysisResults.md b/docs/MetaAnalysisResults.md index caf6cb0..ee784e0 100644 --- a/docs/MetaAnalysisResults.md +++ b/docs/MetaAnalysisResults.md @@ -3,6 +3,7 @@ array of neurostore ids representing the results of this meta-analysis (nominally all results should be the same, but machine architecture differences/algorithm stochastic-ness may lead to slightly different outcomes for each result. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -16,12 +17,12 @@ json = "{}" # create an instance of MetaAnalysisResults from a JSON string meta_analysis_results_instance = MetaAnalysisResults.from_json(json) # print the JSON string representation of the object -print MetaAnalysisResults.to_json() +print(MetaAnalysisResults.to_json()) # convert the object into a dict meta_analysis_results_dict = meta_analysis_results_instance.to_dict() # create an instance of MetaAnalysisResults from a dict -meta_analysis_results_form_dict = meta_analysis_results.from_dict(meta_analysis_results_dict) +meta_analysis_results_from_dict = MetaAnalysisResults.from_dict(meta_analysis_results_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/MetaAnalysisReturn.md b/docs/MetaAnalysisReturn.md index 984fe27..214f9f6 100644 --- a/docs/MetaAnalysisReturn.md +++ b/docs/MetaAnalysisReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **specification** | [**MetaAnalysisSpecification**](MetaAnalysisSpecification.md) | | [optional] @@ -39,12 +40,12 @@ json = "{}" # create an instance of MetaAnalysisReturn from a JSON string meta_analysis_return_instance = MetaAnalysisReturn.from_json(json) # print the JSON string representation of the object -print MetaAnalysisReturn.to_json() +print(MetaAnalysisReturn.to_json()) # convert the object into a dict meta_analysis_return_dict = meta_analysis_return_instance.to_dict() # create an instance of MetaAnalysisReturn from a dict -meta_analysis_return_form_dict = meta_analysis_return.from_dict(meta_analysis_return_dict) +meta_analysis_return_from_dict = MetaAnalysisReturn.from_dict(meta_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/MetaAnalysisSpecification.md b/docs/MetaAnalysisSpecification.md index a5f80cf..4d0e245 100644 --- a/docs/MetaAnalysisSpecification.md +++ b/docs/MetaAnalysisSpecification.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future. | [optional] @@ -24,12 +25,12 @@ json = "{}" # create an instance of MetaAnalysisSpecification from a JSON string meta_analysis_specification_instance = MetaAnalysisSpecification.from_json(json) # print the JSON string representation of the object -print MetaAnalysisSpecification.to_json() +print(MetaAnalysisSpecification.to_json()) # convert the object into a dict meta_analysis_specification_dict = meta_analysis_specification_instance.to_dict() # create an instance of MetaAnalysisSpecification from a dict -meta_analysis_specification_form_dict = meta_analysis_specification.from_dict(meta_analysis_specification_dict) +meta_analysis_specification_from_dict = MetaAnalysisSpecification.from_dict(meta_analysis_specification_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/MetaAnalysisStudyset.md b/docs/MetaAnalysisStudyset.md index 237b18c..cb2ad7c 100644 --- a/docs/MetaAnalysisStudyset.md +++ b/docs/MetaAnalysisStudyset.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | The id of the studyset on neurostore. | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of MetaAnalysisStudyset from a JSON string meta_analysis_studyset_instance = MetaAnalysisStudyset.from_json(json) # print the JSON string representation of the object -print MetaAnalysisStudyset.to_json() +print(MetaAnalysisStudyset.to_json()) # convert the object into a dict meta_analysis_studyset_dict = meta_analysis_studyset_instance.to_dict() # create an instance of MetaAnalysisStudyset from a dict -meta_analysis_studyset_form_dict = meta_analysis_studyset.from_dict(meta_analysis_studyset_dict) +meta_analysis_studyset_from_dict = MetaAnalysisStudyset.from_dict(meta_analysis_studyset_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/NeurostoreAnalysis.md b/docs/NeurostoreAnalysis.md index fa30e2c..c4c3d55 100644 --- a/docs/NeurostoreAnalysis.md +++ b/docs/NeurostoreAnalysis.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | | [optional] [readonly] @@ -19,12 +20,12 @@ json = "{}" # create an instance of NeurostoreAnalysis from a JSON string neurostore_analysis_instance = NeurostoreAnalysis.from_json(json) # print the JSON string representation of the object -print NeurostoreAnalysis.to_json() +print(NeurostoreAnalysis.to_json()) # convert the object into a dict neurostore_analysis_dict = neurostore_analysis_instance.to_dict() # create an instance of NeurostoreAnalysis from a dict -neurostore_analysis_form_dict = neurostore_analysis.from_dict(neurostore_analysis_dict) +neurostore_analysis_from_dict = NeurostoreAnalysis.from_dict(neurostore_analysis_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/NeurostoreStudy.md b/docs/NeurostoreStudy.md index 0eea677..a8cd8a7 100644 --- a/docs/NeurostoreStudy.md +++ b/docs/NeurostoreStudy.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | | [optional] [readonly] @@ -20,12 +21,12 @@ json = "{}" # create an instance of NeurostoreStudy from a JSON string neurostore_study_instance = NeurostoreStudy.from_json(json) # print the JSON string representation of the object -print NeurostoreStudy.to_json() +print(NeurostoreStudy.to_json()) # convert the object into a dict neurostore_study_dict = neurostore_study_instance.to_dict() # create an instance of NeurostoreStudy from a dict -neurostore_study_form_dict = neurostore_study.from_dict(neurostore_study_dict) +neurostore_study_from_dict = NeurostoreStudy.from_dict(neurostore_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/NeurostoreStudyList.md b/docs/NeurostoreStudyList.md index c54c05d..b046efc 100644 --- a/docs/NeurostoreStudyList.md +++ b/docs/NeurostoreStudyList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[NeurostoreStudyReturn]**](NeurostoreStudyReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of NeurostoreStudyList from a JSON string neurostore_study_list_instance = NeurostoreStudyList.from_json(json) # print the JSON string representation of the object -print NeurostoreStudyList.to_json() +print(NeurostoreStudyList.to_json()) # convert the object into a dict neurostore_study_list_dict = neurostore_study_list_instance.to_dict() # create an instance of NeurostoreStudyList from a dict -neurostore_study_list_form_dict = neurostore_study_list.from_dict(neurostore_study_list_dict) +neurostore_study_list_from_dict = NeurostoreStudyList.from_dict(neurostore_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/NeurostoreStudyReturn.md b/docs/NeurostoreStudyReturn.md index b145fd3..d9d9524 100644 --- a/docs/NeurostoreStudyReturn.md +++ b/docs/NeurostoreStudyReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | | [optional] [readonly] @@ -25,12 +26,12 @@ json = "{}" # create an instance of NeurostoreStudyReturn from a JSON string neurostore_study_return_instance = NeurostoreStudyReturn.from_json(json) # print the JSON string representation of the object -print NeurostoreStudyReturn.to_json() +print(NeurostoreStudyReturn.to_json()) # convert the object into a dict neurostore_study_return_dict = neurostore_study_return_instance.to_dict() # create an instance of NeurostoreStudyReturn from a dict -neurostore_study_return_form_dict = neurostore_study_return.from_dict(neurostore_study_return_dict) +neurostore_study_return_from_dict = NeurostoreStudyReturn.from_dict(neurostore_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/NeurovaultCollection.md b/docs/NeurovaultCollection.md index c23693b..d369b70 100644 --- a/docs/NeurovaultCollection.md +++ b/docs/NeurovaultCollection.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collection_id** | **str** | | [optional] [readonly] @@ -18,12 +19,12 @@ json = "{}" # create an instance of NeurovaultCollection from a JSON string neurovault_collection_instance = NeurovaultCollection.from_json(json) # print the JSON string representation of the object -print NeurovaultCollection.to_json() +print(NeurovaultCollection.to_json()) # convert the object into a dict neurovault_collection_dict = neurovault_collection_instance.to_dict() # create an instance of NeurovaultCollection from a dict -neurovault_collection_form_dict = neurovault_collection.from_dict(neurovault_collection_dict) +neurovault_collection_from_dict = NeurovaultCollection.from_dict(neurovault_collection_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/NeurovaultCollectionFiles.md b/docs/NeurovaultCollectionFiles.md index 30de55b..2f4643a 100644 --- a/docs/NeurovaultCollectionFiles.md +++ b/docs/NeurovaultCollectionFiles.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of NeurovaultCollectionFiles from a JSON string neurovault_collection_files_instance = NeurovaultCollectionFiles.from_json(json) # print the JSON string representation of the object -print NeurovaultCollectionFiles.to_json() +print(NeurovaultCollectionFiles.to_json()) # convert the object into a dict neurovault_collection_files_dict = neurovault_collection_files_instance.to_dict() # create an instance of NeurovaultCollectionFiles from a dict -neurovault_collection_files_form_dict = neurovault_collection_files.from_dict(neurovault_collection_files_dict) +neurovault_collection_files_from_dict = NeurovaultCollectionFiles.from_dict(neurovault_collection_files_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/NeurovaultCollectionReturn.md b/docs/NeurovaultCollectionReturn.md index d9aa0b7..b9abe31 100644 --- a/docs/NeurovaultCollectionReturn.md +++ b/docs/NeurovaultCollectionReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collection_id** | **str** | | [optional] [readonly] @@ -23,12 +24,12 @@ json = "{}" # create an instance of NeurovaultCollectionReturn from a JSON string neurovault_collection_return_instance = NeurovaultCollectionReturn.from_json(json) # print the JSON string representation of the object -print NeurovaultCollectionReturn.to_json() +print(NeurovaultCollectionReturn.to_json()) # convert the object into a dict neurovault_collection_return_dict = neurovault_collection_return_instance.to_dict() # create an instance of NeurovaultCollectionReturn from a dict -neurovault_collection_return_form_dict = neurovault_collection_return.from_dict(neurovault_collection_return_dict) +neurovault_collection_return_from_dict = NeurovaultCollectionReturn.from_dict(neurovault_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/NeurovaultFile.md b/docs/NeurovaultFile.md index c003781..322c287 100644 --- a/docs/NeurovaultFile.md +++ b/docs/NeurovaultFile.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collection_id** | **str** | | [optional] @@ -22,12 +23,12 @@ json = "{}" # create an instance of NeurovaultFile from a JSON string neurovault_file_instance = NeurovaultFile.from_json(json) # print the JSON string representation of the object -print NeurovaultFile.to_json() +print(NeurovaultFile.to_json()) # convert the object into a dict neurovault_file_dict = neurovault_file_instance.to_dict() # create an instance of NeurovaultFile from a dict -neurovault_file_form_dict = neurovault_file.from_dict(neurovault_file_dict) +neurovault_file_from_dict = NeurovaultFile.from_dict(neurovault_file_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/NeurovaultFileList.md b/docs/NeurovaultFileList.md index 3b462f8..d67ca9b 100644 --- a/docs/NeurovaultFileList.md +++ b/docs/NeurovaultFileList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[NeurovaultFileReturn]**](NeurovaultFileReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of NeurovaultFileList from a JSON string neurovault_file_list_instance = NeurovaultFileList.from_json(json) # print the JSON string representation of the object -print NeurovaultFileList.to_json() +print(NeurovaultFileList.to_json()) # convert the object into a dict neurovault_file_list_dict = neurovault_file_list_instance.to_dict() # create an instance of NeurovaultFileList from a dict -neurovault_file_list_form_dict = neurovault_file_list.from_dict(neurovault_file_list_dict) +neurovault_file_list_from_dict = NeurovaultFileList.from_dict(neurovault_file_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/NeurovaultFileReturn.md b/docs/NeurovaultFileReturn.md index d8b01ed..952f1d8 100644 --- a/docs/NeurovaultFileReturn.md +++ b/docs/NeurovaultFileReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **collection_id** | **str** | | [optional] @@ -27,12 +28,12 @@ json = "{}" # create an instance of NeurovaultFileReturn from a JSON string neurovault_file_return_instance = NeurovaultFileReturn.from_json(json) # print the JSON string representation of the object -print NeurovaultFileReturn.to_json() +print(NeurovaultFileReturn.to_json()) # convert the object into a dict neurovault_file_return_dict = neurovault_file_return_instance.to_dict() # create an instance of NeurovaultFileReturn from a dict -neurovault_file_return_form_dict = neurovault_file_return.from_dict(neurovault_file_return_dict) +neurovault_file_return_from_dict = NeurovaultFileReturn.from_dict(neurovault_file_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/NeurovaultList.md b/docs/NeurovaultList.md index f9375ec..1194e6c 100644 --- a/docs/NeurovaultList.md +++ b/docs/NeurovaultList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[NeurovaultCollectionReturn]**](NeurovaultCollectionReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of NeurovaultList from a JSON string neurovault_list_instance = NeurovaultList.from_json(json) # print the JSON string representation of the object -print NeurovaultList.to_json() +print(NeurovaultList.to_json()) # convert the object into a dict neurovault_list_dict = neurovault_list_instance.to_dict() # create an instance of NeurovaultList from a dict -neurovault_list_form_dict = neurovault_list.from_dict(neurovault_list_dict) +neurovault_list_from_dict = NeurovaultList.from_dict(neurovault_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/PostApi.md b/docs/PostApi.md index 3794ef1..8ec26f9 100644 --- a/docs/PostApi.md +++ b/docs/PostApi.md @@ -7,8 +7,6 @@ Method | HTTP request | Description [**annotations_post**](PostApi.md#annotations_post) | **POST** /annotations | Create a new Annotation [**meta_analyses_post**](PostApi.md#meta_analyses_post) | **POST** /meta-analyses | Create a new meta-analysis [**meta_analysis_results_post**](PostApi.md#meta_analysis_results_post) | **POST** /meta-analysis-results | -[**neurovault_collections_post**](PostApi.md#neurovault_collections_post) | **POST** /neurovault-collections | Create neurovault collection -[**neurovault_files_post**](PostApi.md#neurovault_files_post) | **POST** /neurovault-files | [**projects_post**](PostApi.md#projects_post) | **POST** /projects | [**specifications_post**](PostApi.md#specifications_post) | **POST** /specifications | Create a Specification [**studysets_post**](PostApi.md#studysets_post) | **POST** /studysets | Create a new Studyset @@ -24,9 +22,8 @@ create a new serialized/referenced annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn @@ -65,8 +62,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **annotation_post_body** | [**AnnotationPostBody**](AnnotationPostBody.md)| | [optional] @@ -85,6 +84,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -104,9 +104,8 @@ create a new specification, studyset, annotation bundle ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn @@ -145,8 +144,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **meta_analysis_post_body** | [**MetaAnalysisPostBody**](MetaAnalysisPostBody.md)| | [optional] @@ -165,6 +166,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -183,9 +185,8 @@ Name | Type | Description | Notes * Bearer Authentication (JSON-Web-Token): * Api Key Authentication (upload_key): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result_init import ResultInit from neurosynth_compose_sdk.models.result_return import ResultReturn @@ -230,8 +231,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **result_init** | [**ResultInit**](ResultInit.md)| | [optional] @@ -250,155 +253,7 @@ Name | Type | Description | Notes - **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) - -# **neurovault_collections_post** -> neurovault_collections_post(neurovault_collection=neurovault_collection) - -Create neurovault collection - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_collection import NeurovaultCollection -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.PostApi(api_client) - neurovault_collection = neurosynth_compose_sdk.NeurovaultCollection() # NeurovaultCollection | (optional) - - try: - # Create neurovault collection - api_instance.neurovault_collections_post(neurovault_collection=neurovault_collection) - except Exception as e: - print("Exception when calling PostApi->neurovault_collections_post: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **neurovault_collection** | [**NeurovaultCollection**](NeurovaultCollection.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### 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) - -# **neurovault_files_post** -> NeurovaultFileReturn neurovault_files_post(neurovault_file=neurovault_file) - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file import NeurovaultFile -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.PostApi(api_client) - neurovault_file = neurosynth_compose_sdk.NeurovaultFile() # NeurovaultFile | (optional) - - try: - # - api_response = api_instance.neurovault_files_post(neurovault_file=neurovault_file) - print("The response of PostApi->neurovault_files_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PostApi->neurovault_files_post: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **neurovault_file** | [**NeurovaultFile**](NeurovaultFile.md)| | [optional] - -### Return type - -[**NeurovaultFileReturn**](NeurovaultFileReturn.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 | - | @@ -413,9 +268,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -454,8 +308,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project** | [**Project**](Project.md)| | [optional] @@ -474,6 +330,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -490,9 +347,8 @@ create a new meta-analysis specification ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_post_body import SpecificationPostBody from neurosynth_compose_sdk.models.specification_return import SpecificationReturn @@ -531,8 +387,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **specification_post_body** | [**SpecificationPostBody**](SpecificationPostBody.md)| | [optional] @@ -551,6 +409,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -570,9 +429,8 @@ create a new serialized/referenced studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_post_body import StudysetPostBody from neurosynth_compose_sdk.models.studyset_return import StudysetReturn @@ -611,8 +469,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_post_body** | [**StudysetPostBody**](StudysetPostBody.md)| | [optional] @@ -631,6 +491,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/Project.md b/docs/Project.md index 2d8a6c8..d0a9674 100644 --- a/docs/Project.md +++ b/docs/Project.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **provenance** | **object** | | [optional] @@ -23,12 +24,12 @@ json = "{}" # create an instance of Project from a JSON string project_instance = Project.from_json(json) # print the JSON string representation of the object -print Project.to_json() +print(Project.to_json()) # convert the object into a dict project_dict = project_instance.to_dict() # create an instance of Project from a dict -project_form_dict = project.from_dict(project_dict) +project_from_dict = Project.from_dict(project_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/ProjectList.md b/docs/ProjectList.md index 1e71e2b..cd78385 100644 --- a/docs/ProjectList.md +++ b/docs/ProjectList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[ProjectReturn]**](ProjectReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of ProjectList from a JSON string project_list_instance = ProjectList.from_json(json) # print the JSON string representation of the object -print ProjectList.to_json() +print(ProjectList.to_json()) # convert the object into a dict project_list_dict = project_list_instance.to_dict() # create an instance of ProjectList from a dict -project_list_form_dict = project_list.from_dict(project_list_dict) +project_list_from_dict = ProjectList.from_dict(project_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/ProjectMetaAnalyses.md b/docs/ProjectMetaAnalyses.md index 2b842ce..a4042ee 100644 --- a/docs/ProjectMetaAnalyses.md +++ b/docs/ProjectMetaAnalyses.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of ProjectMetaAnalyses from a JSON string project_meta_analyses_instance = ProjectMetaAnalyses.from_json(json) # print the JSON string representation of the object -print ProjectMetaAnalyses.to_json() +print(ProjectMetaAnalyses.to_json()) # convert the object into a dict project_meta_analyses_dict = project_meta_analyses_instance.to_dict() # create an instance of ProjectMetaAnalyses from a dict -project_meta_analyses_form_dict = project_meta_analyses.from_dict(project_meta_analyses_dict) +project_meta_analyses_from_dict = ProjectMetaAnalyses.from_dict(project_meta_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/ProjectReturn.md b/docs/ProjectReturn.md index b3f16d9..e12f45d 100644 --- a/docs/ProjectReturn.md +++ b/docs/ProjectReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | the identifier for the resource. | [optional] @@ -28,12 +29,12 @@ json = "{}" # create an instance of ProjectReturn from a JSON string project_return_instance = ProjectReturn.from_json(json) # print the JSON string representation of the object -print ProjectReturn.to_json() +print(ProjectReturn.to_json()) # convert the object into a dict project_return_dict = project_return_instance.to_dict() # create an instance of ProjectReturn from a dict -project_return_form_dict = project_return.from_dict(project_return_dict) +project_return_from_dict = ProjectReturn.from_dict(project_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/ProjectsApi.md b/docs/ProjectsApi.md index 06a83a7..194b634 100644 --- a/docs/ProjectsApi.md +++ b/docs/ProjectsApi.md @@ -19,9 +19,8 @@ Your GET endpoint ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project_list import ProjectList from neurosynth_compose_sdk.rest import ApiException @@ -66,8 +65,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| page of results | [optional] @@ -93,6 +94,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -107,9 +109,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.rest import ApiException from pprint import pprint @@ -144,8 +145,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -164,6 +167,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -177,9 +181,8 @@ Your GET endpoint ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project_return import ProjectReturn from neurosynth_compose_sdk.rest import ApiException @@ -209,8 +212,10 @@ with neurosynth_compose_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 | - | @@ -244,9 +250,8 @@ No authorization required ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -286,8 +291,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -307,6 +314,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -321,9 +329,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -362,8 +369,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project** | [**Project**](Project.md)| | [optional] @@ -382,6 +391,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/PutApi.md b/docs/PutApi.md index 927ae2d..04fd97c 100644 --- a/docs/PutApi.md +++ b/docs/PutApi.md @@ -7,8 +7,6 @@ Method | HTTP request | Description [**annotations_id_put**](PutApi.md#annotations_id_put) | **PUT** /annotations/{id} | Update an Annotation [**meta_analyses_id_put**](PutApi.md#meta_analyses_id_put) | **PUT** /meta-analyses/{id} | Update a meta-analysis [**meta_analysis_results_id_put**](PutApi.md#meta_analysis_results_id_put) | **PUT** /meta-analysis-results/{id} | -[**neurovault_collections_id_put**](PutApi.md#neurovault_collections_id_put) | **PUT** /neurovault-collections/{id} | -[**neurovault_files_id_put**](PutApi.md#neurovault_files_id_put) | **PUT** /neurovault-files/{id} | [**projects_id_put**](PutApi.md#projects_id_put) | **PUT** /projects/{id} | [**specifications_id_put**](PutApi.md#specifications_id_put) | **PUT** /specifications/{id} | Update Meta-Analysis specification [**studysets_id_put**](PutApi.md#studysets_id_put) | **PUT** /studysets/{id} | Update a Studyset @@ -24,9 +22,8 @@ update an existing annotation ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate @@ -66,8 +63,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -87,6 +86,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -107,9 +107,8 @@ update an existing meta-analysis (that has not yet been run) ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn @@ -149,8 +148,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -170,6 +171,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -189,9 +191,8 @@ Name | Type | Description | Notes * Bearer Authentication (JSON-Web-Token): * Api Key Authentication (upload_key): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.result import Result from neurosynth_compose_sdk.models.result_return import ResultReturn @@ -237,8 +238,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -258,168 +261,7 @@ Name | Type | Description | Notes - **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) - -# **neurovault_collections_id_put** -> NeurovaultCollectionReturn neurovault_collections_id_put(id) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.PutApi(api_client) - id = 'id_example' # str | - - try: - # - api_response = api_instance.neurovault_collections_id_put(id) - print("The response of PutApi->neurovault_collections_id_put:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PutApi->neurovault_collections_id_put: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - -### Return type - -[**NeurovaultCollectionReturn**](NeurovaultCollectionReturn.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) - -# **neurovault_files_id_put** -> NeurovaultFileReturn neurovault_files_id_put(id, collection_id=collection_id, exception=exception, traceback=traceback, status=status, image_id=image_id, name=name, url=url) - - - -### Example - -* Bearer Authentication (JSON-Web-Token): -```python -import time -import os -import neurosynth_compose_sdk -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn -from neurosynth_compose_sdk.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://compose.neurosynth.org/api -# See configuration.py for a list of all supported configuration parameters. -configuration = neurosynth_compose_sdk.Configuration( - host = "https://compose.neurosynth.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 = neurosynth_compose_sdk.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# Enter a context with an instance of the API client -with neurosynth_compose_sdk.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = neurosynth_compose_sdk.PutApi(api_client) - id = 'id_example' # str | - collection_id = 'collection_id_example' # str | (optional) - exception = 'exception_example' # str | (optional) - traceback = 'traceback_example' # str | (optional) - status = 'status_example' # str | (optional) - image_id = 'image_id_example' # str | (optional) - name = 'name_example' # str | (optional) - url = 'url_example' # str | (optional) - try: - # - api_response = api_instance.neurovault_files_id_put(id, collection_id=collection_id, exception=exception, traceback=traceback, status=status, image_id=image_id, name=name, url=url) - print("The response of PutApi->neurovault_files_id_put:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling PutApi->neurovault_files_id_put: %s\n" % e) -``` - - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| | - **collection_id** | **str**| | [optional] - **exception** | **str**| | [optional] - **traceback** | **str**| | [optional] - **status** | **str**| | [optional] - **image_id** | **str**| | [optional] - **name** | **str**| | [optional] - **url** | **str**| | [optional] - -### Return type - -[**NeurovaultFileReturn**](NeurovaultFileReturn.md) - -### Authorization - -[JSON-Web-Token](../README.md#JSON-Web-Token) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -434,9 +276,8 @@ Name | Type | Description | Notes ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -476,8 +317,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -497,6 +340,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -513,9 +357,8 @@ update an existing meta analysis specification ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification import Specification from neurosynth_compose_sdk.models.specification_return import SpecificationReturn @@ -555,8 +398,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -576,6 +421,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -596,9 +442,8 @@ update an existing serialized/referenced studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset import Studyset from neurosynth_compose_sdk.models.studyset_return import StudysetReturn @@ -638,8 +483,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -659,6 +506,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/ReadOnly.md b/docs/ReadOnly.md index 0bda621..758e726 100644 --- a/docs/ReadOnly.md +++ b/docs/ReadOnly.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | the identifier for the resource. | [optional] @@ -20,12 +21,12 @@ json = "{}" # create an instance of ReadOnly from a JSON string read_only_instance = ReadOnly.from_json(json) # print the JSON string representation of the object -print ReadOnly.to_json() +print(ReadOnly.to_json()) # convert the object into a dict read_only_dict = read_only_instance.to_dict() # create an instance of ReadOnly from a dict -read_only_form_dict = read_only.from_dict(read_only_dict) +read_only_from_dict = ReadOnly.from_dict(read_only_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/Result.md b/docs/Result.md index ff212a1..0a41886 100644 --- a/docs/Result.md +++ b/docs/Result.md @@ -3,6 +3,7 @@ describes the output of a meta-analysis ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **meta_analysis_id** | **str** | the meta analysis this result was derived from. | [optional] @@ -23,12 +24,12 @@ json = "{}" # create an instance of Result from a JSON string result_instance = Result.from_json(json) # print the JSON string representation of the object -print Result.to_json() +print(Result.to_json()) # convert the object into a dict result_dict = result_instance.to_dict() # create an instance of Result from a dict -result_form_dict = result.from_dict(result_dict) +result_from_dict = Result.from_dict(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/ResultInit.md b/docs/ResultInit.md index fef3471..95e422d 100644 --- a/docs/ResultInit.md +++ b/docs/ResultInit.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **meta_analysis_id** | **str** | | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of ResultInit from a JSON string result_init_instance = ResultInit.from_json(json) # print the JSON string representation of the object -print ResultInit.to_json() +print(ResultInit.to_json()) # convert the object into a dict result_init_dict = result_init_instance.to_dict() # create an instance of ResultInit from a dict -result_init_form_dict = result_init.from_dict(result_init_dict) +result_init_from_dict = ResultInit.from_dict(result_init_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/ResultList.md b/docs/ResultList.md index 08f9f7d..1858a6c 100644 --- a/docs/ResultList.md +++ b/docs/ResultList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**ResultListResults**](ResultListResults.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of ResultList from a JSON string result_list_instance = ResultList.from_json(json) # print the JSON string representation of the object -print ResultList.to_json() +print(ResultList.to_json()) # convert the object into a dict result_list_dict = result_list_instance.to_dict() # create an instance of ResultList from a dict -result_list_form_dict = result_list.from_dict(result_list_dict) +result_list_from_dict = ResultList.from_dict(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/ResultListResults.md b/docs/ResultListResults.md index 0d240bf..17f5580 100644 --- a/docs/ResultListResults.md +++ b/docs/ResultListResults.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -15,12 +16,12 @@ json = "{}" # create an instance of ResultListResults from a JSON string result_list_results_instance = ResultListResults.from_json(json) # print the JSON string representation of the object -print ResultListResults.to_json() +print(ResultListResults.to_json()) # convert the object into a dict result_list_results_dict = result_list_results_instance.to_dict() # create an instance of ResultListResults from a dict -result_list_results_form_dict = result_list_results.from_dict(result_list_results_dict) +result_list_results_from_dict = ResultListResults.from_dict(result_list_results_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/ResultReturn.md b/docs/ResultReturn.md index 629385d..5335df1 100644 --- a/docs/ResultReturn.md +++ b/docs/ResultReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **meta_analysis_id** | **str** | the meta analysis this result was derived from. | [optional] @@ -27,12 +28,12 @@ json = "{}" # create an instance of ResultReturn from a JSON string result_return_instance = ResultReturn.from_json(json) # print the JSON string representation of the object -print ResultReturn.to_json() +print(ResultReturn.to_json()) # convert the object into a dict result_return_dict = result_return_instance.to_dict() # create an instance of ResultReturn from a dict -result_return_form_dict = result_return.from_dict(result_return_dict) +result_return_from_dict = ResultReturn.from_dict(result_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/Specification.md b/docs/Specification.md index f180f27..34a8433 100644 --- a/docs/Specification.md +++ b/docs/Specification.md @@ -3,6 +3,7 @@ a machine readable specification of how to run a meta-analysis (currently specifically tailored to NiMARE). ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future. | [optional] @@ -25,12 +26,12 @@ json = "{}" # create an instance of Specification from a JSON string specification_instance = Specification.from_json(json) # print the JSON string representation of the object -print Specification.to_json() +print(Specification.to_json()) # convert the object into a dict specification_dict = specification_instance.to_dict() # create an instance of Specification from a dict -specification_form_dict = specification.from_dict(specification_dict) +specification_from_dict = Specification.from_dict(specification_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/SpecificationConditions.md b/docs/SpecificationConditions.md index 7d2e45c..282323b 100644 --- a/docs/SpecificationConditions.md +++ b/docs/SpecificationConditions.md @@ -3,6 +3,7 @@ selection of categories in the filter column to differentiate groups, or \"neurosynth\", \"neuroquery\", or \"neurostore\" to compare to a database reference group ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -16,12 +17,12 @@ json = "{}" # create an instance of SpecificationConditions from a JSON string specification_conditions_instance = SpecificationConditions.from_json(json) # print the JSON string representation of the object -print SpecificationConditions.to_json() +print(SpecificationConditions.to_json()) # convert the object into a dict specification_conditions_dict = specification_conditions_instance.to_dict() # create an instance of SpecificationConditions from a dict -specification_conditions_form_dict = specification_conditions.from_dict(specification_conditions_dict) +specification_conditions_from_dict = SpecificationConditions.from_dict(specification_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/SpecificationList.md b/docs/SpecificationList.md index e28eb5e..6049955 100644 --- a/docs/SpecificationList.md +++ b/docs/SpecificationList.md @@ -3,6 +3,7 @@ The representation of a list of specifications. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[SpecificationReturn]**](SpecificationReturn.md) | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of SpecificationList from a JSON string specification_list_instance = SpecificationList.from_json(json) # print the JSON string representation of the object -print SpecificationList.to_json() +print(SpecificationList.to_json()) # convert the object into a dict specification_list_dict = specification_list_instance.to_dict() # create an instance of SpecificationList from a dict -specification_list_form_dict = specification_list.from_dict(specification_list_dict) +specification_list_from_dict = SpecificationList.from_dict(specification_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/SpecificationPostBody.md b/docs/SpecificationPostBody.md index d8f5f9a..80c28ce 100644 --- a/docs/SpecificationPostBody.md +++ b/docs/SpecificationPostBody.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future. | [optional] @@ -24,12 +25,12 @@ json = "{}" # create an instance of SpecificationPostBody from a JSON string specification_post_body_instance = SpecificationPostBody.from_json(json) # print the JSON string representation of the object -print SpecificationPostBody.to_json() +print(SpecificationPostBody.to_json()) # convert the object into a dict specification_post_body_dict = specification_post_body_instance.to_dict() # create an instance of SpecificationPostBody from a dict -specification_post_body_form_dict = specification_post_body.from_dict(specification_post_body_dict) +specification_post_body_from_dict = SpecificationPostBody.from_dict(specification_post_body_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/SpecificationReturn.md b/docs/SpecificationReturn.md index 152e7be..d33c452 100644 --- a/docs/SpecificationReturn.md +++ b/docs/SpecificationReturn.md @@ -3,6 +3,7 @@ The view of the specification through an endpoint. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future. | [optional] @@ -30,12 +31,12 @@ json = "{}" # create an instance of SpecificationReturn from a JSON string specification_return_instance = SpecificationReturn.from_json(json) # print the JSON string representation of the object -print SpecificationReturn.to_json() +print(SpecificationReturn.to_json()) # convert the object into a dict specification_return_dict = specification_return_instance.to_dict() # create an instance of SpecificationReturn from a dict -specification_return_form_dict = specification_return.from_dict(specification_return_dict) +specification_return_from_dict = SpecificationReturn.from_dict(specification_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/SpecificationsApi.md b/docs/SpecificationsApi.md index e102f7e..b27e7be 100644 --- a/docs/SpecificationsApi.md +++ b/docs/SpecificationsApi.md @@ -19,9 +19,8 @@ list of meta-analysis specifications ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_list import SpecificationList from neurosynth_compose_sdk.rest import ApiException @@ -49,7 +48,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -66,6 +67,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -82,9 +84,8 @@ get a meta-analysis specification ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_return import SpecificationReturn from neurosynth_compose_sdk.rest import ApiException @@ -113,8 +114,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -133,6 +136,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -151,9 +155,8 @@ update an existing meta analysis specification ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification import Specification from neurosynth_compose_sdk.models.specification_return import SpecificationReturn @@ -193,8 +196,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -214,6 +219,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -234,9 +240,8 @@ create a new meta-analysis specification ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.specification_post_body import SpecificationPostBody from neurosynth_compose_sdk.models.specification_return import SpecificationReturn @@ -275,8 +280,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **specification_post_body** | [**SpecificationPostBody**](SpecificationPostBody.md)| | [optional] @@ -295,6 +302,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/Studyset.md b/docs/Studyset.md index 2b3e704..64308c5 100644 --- a/docs/Studyset.md +++ b/docs/Studyset.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | The id of the studyset on neurostore. | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of Studyset from a JSON string studyset_instance = Studyset.from_json(json) # print the JSON string representation of the object -print Studyset.to_json() +print(Studyset.to_json()) # convert the object into a dict studyset_dict = studyset_instance.to_dict() # create an instance of Studyset from a dict -studyset_form_dict = studyset.from_dict(studyset_dict) +studyset_from_dict = Studyset.from_dict(studyset_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 04df5b6..ce8aa18 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/StudysetPostBody.md b/docs/StudysetPostBody.md index 8b49148..2e7a218 100644 --- a/docs/StudysetPostBody.md +++ b/docs/StudysetPostBody.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | The id of the studyset on neurostore. | @@ -19,12 +20,12 @@ json = "{}" # create an instance of StudysetPostBody from a JSON string studyset_post_body_instance = StudysetPostBody.from_json(json) # print the JSON string representation of the object -print StudysetPostBody.to_json() +print(StudysetPostBody.to_json()) # convert the object into a dict studyset_post_body_dict = studyset_post_body_instance.to_dict() # create an instance of StudysetPostBody from a dict -studyset_post_body_form_dict = studyset_post_body.from_dict(studyset_post_body_dict) +studyset_post_body_from_dict = StudysetPostBody.from_dict(studyset_post_body_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/StudysetReference.md b/docs/StudysetReference.md index eba159b..5f44b38 100644 --- a/docs/StudysetReference.md +++ b/docs/StudysetReference.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **snapshots** | [**List[StudysetReferenceSnapshotsInner]**](StudysetReferenceSnapshotsInner.md) | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of StudysetReference from a JSON string studyset_reference_instance = StudysetReference.from_json(json) # print the JSON string representation of the object -print StudysetReference.to_json() +print(StudysetReference.to_json()) # convert the object into a dict studyset_reference_dict = studyset_reference_instance.to_dict() # create an instance of StudysetReference from a dict -studyset_reference_form_dict = studyset_reference.from_dict(studyset_reference_dict) +studyset_reference_from_dict = StudysetReference.from_dict(studyset_reference_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/StudysetReferenceList.md b/docs/StudysetReferenceList.md index aba3a9a..4d461af 100644 --- a/docs/StudysetReferenceList.md +++ b/docs/StudysetReferenceList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[StudysetReferenceReturn]**](StudysetReferenceReturn.md) | | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of StudysetReferenceList from a JSON string studyset_reference_list_instance = StudysetReferenceList.from_json(json) # print the JSON string representation of the object -print StudysetReferenceList.to_json() +print(StudysetReferenceList.to_json()) # convert the object into a dict studyset_reference_list_dict = studyset_reference_list_instance.to_dict() # create an instance of StudysetReferenceList from a dict -studyset_reference_list_form_dict = studyset_reference_list.from_dict(studyset_reference_list_dict) +studyset_reference_list_from_dict = StudysetReferenceList.from_dict(studyset_reference_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/StudysetReferenceReturn.md b/docs/StudysetReferenceReturn.md index cea5ba7..ae3f92f 100644 --- a/docs/StudysetReferenceReturn.md +++ b/docs/StudysetReferenceReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **snapshots** | [**List[StudysetReferenceSnapshotsInner]**](StudysetReferenceSnapshotsInner.md) | | [optional] @@ -21,12 +22,12 @@ json = "{}" # create an instance of StudysetReferenceReturn from a JSON string studyset_reference_return_instance = StudysetReferenceReturn.from_json(json) # print the JSON string representation of the object -print StudysetReferenceReturn.to_json() +print(StudysetReferenceReturn.to_json()) # convert the object into a dict studyset_reference_return_dict = studyset_reference_return_instance.to_dict() # create an instance of StudysetReferenceReturn from a dict -studyset_reference_return_form_dict = studyset_reference_return.from_dict(studyset_reference_return_dict) +studyset_reference_return_from_dict = StudysetReferenceReturn.from_dict(studyset_reference_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/StudysetReferenceSnapshotsInner.md b/docs/StudysetReferenceSnapshotsInner.md index 9c0b911..ec40893 100644 --- a/docs/StudysetReferenceSnapshotsInner.md +++ b/docs/StudysetReferenceSnapshotsInner.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | The id of the studyset on neurostore. | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of StudysetReferenceSnapshotsInner from a JSON string studyset_reference_snapshots_inner_instance = StudysetReferenceSnapshotsInner.from_json(json) # print the JSON string representation of the object -print StudysetReferenceSnapshotsInner.to_json() +print(StudysetReferenceSnapshotsInner.to_json()) # convert the object into a dict studyset_reference_snapshots_inner_dict = studyset_reference_snapshots_inner_instance.to_dict() # create an instance of StudysetReferenceSnapshotsInner from a dict -studyset_reference_snapshots_inner_form_dict = studyset_reference_snapshots_inner.from_dict(studyset_reference_snapshots_inner_dict) +studyset_reference_snapshots_inner_from_dict = StudysetReferenceSnapshotsInner.from_dict(studyset_reference_snapshots_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 9f1be6b..f651931 100644 --- a/docs/StudysetReturn.md +++ b/docs/StudysetReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **neurostore_id** | **str** | The id of the studyset on neurostore. | [optional] @@ -24,12 +25,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/StudysetsApi.md b/docs/StudysetsApi.md index 23fcce7..a06f2a9 100644 --- a/docs/StudysetsApi.md +++ b/docs/StudysetsApi.md @@ -19,9 +19,8 @@ get a list of serialized/referenced studysets ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_list import StudysetList from neurosynth_compose_sdk.rest import ApiException @@ -49,7 +48,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -66,6 +67,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -82,9 +84,8 @@ get a single serialized/referenced studyset ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_return import StudysetReturn from neurosynth_compose_sdk.rest import ApiException @@ -113,8 +114,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -133,6 +136,7 @@ No authorization required - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -151,9 +155,8 @@ update an existing serialized/referenced studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset import Studyset from neurosynth_compose_sdk.models.studyset_return import StudysetReturn @@ -193,8 +196,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -214,6 +219,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -234,9 +240,8 @@ create a new serialized/referenced studyset ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.studyset_post_body import StudysetPostBody from neurosynth_compose_sdk.models.studyset_return import StudysetReturn @@ -275,8 +280,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **studyset_post_body** | [**StudysetPostBody**](StudysetPostBody.md)| | [optional] @@ -295,6 +302,7 @@ Name | Type | Description | Notes - **Accept**: application/json, application/problem+json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/docs/User.md b/docs/User.md index 76cb88e..6944916 100644 --- a/docs/User.md +++ b/docs/User.md @@ -3,6 +3,7 @@ attributes of the user object ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **external_id** | **str** | | [optional] @@ -17,12 +18,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/UserList.md b/docs/UserList.md index 51825b5..d889b58 100644 --- a/docs/UserList.md +++ b/docs/UserList.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**List[UserReturn]**](UserReturn.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/UserReturn.md b/docs/UserReturn.md index dac9a9a..1742e81 100644 --- a/docs/UserReturn.md +++ b/docs/UserReturn.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **external_id** | **str** | | [optional] @@ -21,12 +22,12 @@ json = "{}" # create an instance of UserReturn from a JSON string user_return_instance = UserReturn.from_json(json) # print the JSON string representation of the object -print UserReturn.to_json() +print(UserReturn.to_json()) # convert the object into a dict user_return_dict = user_return_instance.to_dict() # create an instance of UserReturn from a dict -user_return_form_dict = user_return.from_dict(user_return_dict) +user_return_from_dict = UserReturn.from_dict(user_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/UsersApi.md b/docs/UsersApi.md index 11f2618..6368248 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -19,9 +19,8 @@ List all users ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.user_list import UserList from neurosynth_compose_sdk.rest import ApiException @@ -49,7 +48,9 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + This endpoint does not need any parameter. ### Return type @@ -66,6 +67,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -81,9 +83,8 @@ Retrieve the information of the user with the matching user ID. ### Example + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.user_return import UserReturn from neurosynth_compose_sdk.rest import ApiException @@ -112,8 +113,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -132,6 +135,7 @@ No authorization required - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -148,9 +152,8 @@ update information about a user ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.user import User from neurosynth_compose_sdk.models.user_return import UserReturn @@ -190,8 +193,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | **str**| | @@ -211,6 +216,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | @@ -227,9 +233,8 @@ create a single user ### Example * Bearer Authentication (JSON-Web-Token): + ```python -import time -import os import neurosynth_compose_sdk from neurosynth_compose_sdk.models.user import User from neurosynth_compose_sdk.models.user_return import UserReturn @@ -268,8 +273,10 @@ with neurosynth_compose_sdk.ApiClient(configuration) as api_client: ``` + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | [**User**](User.md)| | [optional] @@ -288,6 +295,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK | - | diff --git a/neurosynth_compose_sdk/__init__.py b/neurosynth_compose_sdk/__init__.py index e89455f..5ea7797 100644 --- a/neurosynth_compose_sdk/__init__.py +++ b/neurosynth_compose_sdk/__init__.py @@ -5,14 +5,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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" @@ -23,7 +23,6 @@ from neurosynth_compose_sdk.api.default_api import DefaultApi from neurosynth_compose_sdk.api.get_api import GetApi from neurosynth_compose_sdk.api.meta_analyses_api import MetaAnalysesApi -from neurosynth_compose_sdk.api.neurovault_api import NeurovaultApi from neurosynth_compose_sdk.api.post_api import PostApi from neurosynth_compose_sdk.api.projects_api import ProjectsApi from neurosynth_compose_sdk.api.put_api import PutApi @@ -48,7 +47,6 @@ from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate -from neurosynth_compose_sdk.models.annotation_update_all_of import AnnotationUpdateAllOf from neurosynth_compose_sdk.models.corrector import Corrector from neurosynth_compose_sdk.models.estimator import Estimator from neurosynth_compose_sdk.models.meta_analyses_get400_response import MetaAnalysesGet400Response diff --git a/neurosynth_compose_sdk/api/__init__.py b/neurosynth_compose_sdk/api/__init__.py index e0ad6ec..a78dc7e 100644 --- a/neurosynth_compose_sdk/api/__init__.py +++ b/neurosynth_compose_sdk/api/__init__.py @@ -6,7 +6,6 @@ from neurosynth_compose_sdk.api.default_api import DefaultApi from neurosynth_compose_sdk.api.get_api import GetApi from neurosynth_compose_sdk.api.meta_analyses_api import MetaAnalysesApi -from neurosynth_compose_sdk.api.neurovault_api import NeurovaultApi from neurosynth_compose_sdk.api.post_api import PostApi from neurosynth_compose_sdk.api.projects_api import ProjectsApi from neurosynth_compose_sdk.api.put_api import PutApi diff --git a/neurosynth_compose_sdk/api/annotations_api.py b/neurosynth_compose_sdk/api/annotations_api.py index 1377d14..5150bb0 100644 --- a/neurosynth_compose_sdk/api/annotations_api.py +++ b/neurosynth_compose_sdk/api/annotations_api.py @@ -3,628 +3,1142 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.annotation_list import AnnotationList from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_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 annotations_get(self, **kwargs) -> AnnotationList: # noqa: E501 - """GET a list of annotations # noqa: E501 - get a list of serialized/referenced annotations # 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """GET a list of annotations - >>> thread = api.annotations_get(async_req=True) - >>> result = thread.get() + get a list of serialized/referenced annotations - :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(**kwargs) # noqa: E501 - - @validate_arguments - def annotations_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of annotations # noqa: E501 - - get a list of serialized/referenced annotations # 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(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._annotations_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + '400': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """GET a list of annotations + + get a list of serialized/referenced annotations + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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 - _params = locals() + _param = self._annotations_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': "AnnotationList", + '400': "MetaAnalysesGet400Response", + } + 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 annotations_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 annotations + + get a list of serialized/referenced annotations + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + _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", + '400': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationList", - '400': "MetaAnalysesGet400Response", - } + # 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_get(self, id : StrictStr, **kwargs) -> AnnotationReturn: # noqa: E501 - """GET information about an annotation # noqa: E501 - get a single 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, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_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, + ) -> AnnotationReturn: + """GET information about an annotation + + get a single 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: 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, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET information about an annotation # noqa: E501 - - get a single 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, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_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': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """GET information about an annotation + + get a single 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: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_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': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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_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 information about an annotation + + get a single 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_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 annotations_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # 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_update : Optional[AnnotationUpdate] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Update an Annotation # noqa: E501 - update 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_update, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_id_put( + self, + id: StrictStr, + annotation_update: Optional[AnnotationUpdate] = 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 + + update an existing annotation :param id: (required) :type id: str :param annotation_update: :type annotation_update: AnnotationUpdate - :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_update, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_put_with_http_info(self, id : StrictStr, annotation_update : Optional[AnnotationUpdate] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an Annotation # noqa: E501 - - update 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_update, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_update=annotation_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update: Optional[AnnotationUpdate] = 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 + + update an existing annotation :param id: (required) :type id: str :param annotation_update: :type annotation_update: AnnotationUpdate - :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_update=annotation_update, + _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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update' - ] - _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_update: Optional[AnnotationUpdate] = 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 + + update an existing annotation + + :param id: (required) + :type id: str + :param annotation_update: + :type annotation_update: AnnotationUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_update=annotation_update, + _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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update, + _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_update'] is not None: - _body_params = _params['annotation_update'] + if annotation_update is not None: + _body_params = annotation_update + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _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, annotation_post_body : Optional[AnnotationPostBody] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Create a new Annotation # noqa: E501 - create a new serialized/referenced 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, + annotation_post_body: Optional[AnnotationPostBody] = 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: + """Create a new Annotation - >>> thread = api.annotations_post(annotation_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced annotation :param annotation_post_body: :type annotation_post_body: AnnotationPostBody - :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(annotation_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_post_with_http_info(self, annotation_post_body : Optional[AnnotationPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new Annotation # noqa: E501 - - create a new serialized/referenced 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(annotation_post_body, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_post_serialize( + annotation_post_body=annotation_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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, + annotation_post_body: Optional[AnnotationPostBody] = 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]: + """Create a new Annotation + + create a new serialized/referenced annotation :param annotation_post_body: :type annotation_post_body: AnnotationPostBody - :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( + annotation_post_body=annotation_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'annotation_post_body' - ] - _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, + annotation_post_body: Optional[AnnotationPostBody] = 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 new Annotation + + create a new serialized/referenced annotation + + :param annotation_post_body: + :type annotation_post_body: AnnotationPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + annotation_post_body=annotation_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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, + annotation_post_body, + _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['annotation_post_body'] is not None: - _body_params = _params['annotation_post_body'] + if annotation_post_body is not None: + _body_params = annotation_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _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/neurosynth_compose_sdk/api/compose_api.py b/neurosynth_compose_sdk/api/compose_api.py index 9a8e69a..fb87494 100644 --- a/neurosynth_compose_sdk/api/compose_api.py +++ b/neurosynth_compose_sdk/api/compose_api.py @@ -3,27 +3,23 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 typing import Optional - +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated from neurosynth_compose_sdk.models.annotation_list import AnnotationList from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn @@ -32,11 +28,6 @@ from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.models.neurovault_collection import NeurovaultCollection -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn -from neurosynth_compose_sdk.models.neurovault_file import NeurovaultFile -from neurosynth_compose_sdk.models.neurovault_file_list import NeurovaultFileList -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_list import ProjectList from neurosynth_compose_sdk.models.project_return import ProjectReturn @@ -53,616 +44,1154 @@ from neurosynth_compose_sdk.models.studyset_post_body import StudysetPostBody from neurosynth_compose_sdk.models.studyset_return import StudysetReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class ComposeApi(object): +class ComposeApi: """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 annotations_get(self, **kwargs) -> AnnotationList: # noqa: E501 - """GET a list of annotations # noqa: E501 - get a list of serialized/referenced annotations # 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """GET a list of annotations - >>> thread = api.annotations_get(async_req=True) - >>> result = thread.get() + get a list of serialized/referenced annotations - :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(**kwargs) # noqa: E501 - - @validate_arguments - def annotations_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of annotations # noqa: E501 - - get a list of serialized/referenced annotations # 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(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._annotations_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + '400': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """GET a list of annotations + + get a list of serialized/referenced annotations + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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 - _params = locals() + _param = self._annotations_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': "AnnotationList", + '400': "MetaAnalysesGet400Response", + } + 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 annotations_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 annotations + + get a list of serialized/referenced annotations + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + _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", + '400': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationList", - '400': "MetaAnalysesGet400Response", - } + # 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_get(self, id : StrictStr, **kwargs) -> AnnotationReturn: # noqa: E501 - """GET information about an annotation # noqa: E501 - get a single 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, async_req=True) - >>> result = thread.get() + @validate_call + def annotations_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, + ) -> AnnotationReturn: + """GET information about an annotation + + get a single 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: 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, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET information about an annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - get a single 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", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """GET information about an annotation - >>> thread = api.annotations_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + get a single 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: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_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': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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_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 information about an annotation + + get a single 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_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 annotations_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # 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_update : Optional[AnnotationUpdate] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Update an Annotation # noqa: E501 - update 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 + @validate_call + def annotations_id_put( + self, + id: StrictStr, + annotation_update: Optional[AnnotationUpdate] = 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 - >>> thread = api.annotations_id_put(id, annotation_update, async_req=True) - >>> result = thread.get() + update an existing annotation :param id: (required) :type id: str :param annotation_update: :type annotation_update: AnnotationUpdate - :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_update, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_put_with_http_info(self, id : StrictStr, annotation_update : Optional[AnnotationUpdate] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an Annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_update=annotation_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update 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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update: Optional[AnnotationUpdate] = 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_update, async_req=True) - >>> result = thread.get() + update an existing annotation :param id: (required) :type id: str :param annotation_update: :type annotation_update: AnnotationUpdate - :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_update=annotation_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update' - ] - _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_update: Optional[AnnotationUpdate] = 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 + + update an existing annotation + + :param id: (required) + :type id: str + :param annotation_update: + :type annotation_update: AnnotationUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_update=annotation_update, + _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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update, + _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_update'] is not None: - _body_params = _params['annotation_update'] + if annotation_update is not None: + _body_params = annotation_update + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _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, annotation_post_body : Optional[AnnotationPostBody] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Create a new Annotation # noqa: E501 - create a new serialized/referenced 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, + annotation_post_body: Optional[AnnotationPostBody] = 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: + """Create a new Annotation - >>> thread = api.annotations_post(annotation_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced annotation :param annotation_post_body: :type annotation_post_body: AnnotationPostBody - :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(annotation_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_post_with_http_info(self, annotation_post_body : Optional[AnnotationPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new Annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_post_serialize( + annotation_post_body=annotation_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new serialized/referenced 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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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, + annotation_post_body: Optional[AnnotationPostBody] = 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]: + """Create a new Annotation - >>> thread = api.annotations_post_with_http_info(annotation_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced annotation :param annotation_post_body: :type annotation_post_body: AnnotationPostBody - :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( + annotation_post_body=annotation_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'annotation_post_body' - ] - _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, + annotation_post_body: Optional[AnnotationPostBody] = 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 new Annotation + + create a new serialized/referenced annotation + + :param annotation_post_body: + :type annotation_post_body: AnnotationPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + annotation_post_body=annotation_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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, + annotation_post_body, + _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['annotation_post_body'] is not None: - _body_params = _params['annotation_post_body'] + if annotation_post_body is not None: + _body_params = annotation_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _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 meta_analyses_get(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, ids : Annotated[Optional[conlist(StrictStr)], Field(description="choose the specific ids you wish to get")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, **kwargs) -> MetaAnalysisList: # noqa: E501 - """GET a list of meta-analyses # noqa: E501 - list all runnable specification, studyset, annotation bundles # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_get(nested, ids, page, page_size, name, search, description, sort, desc, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_get( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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, + ) -> MetaAnalysisList: + """GET a list of meta-analyses + + list all runnable specification, studyset, annotation bundles :param nested: show nested component instead of id :type nested: bool @@ -682,32 +1211,87 @@ def meta_analyses_get(self, nested : Annotated[Optional[StrictBool], Field(descr :type sort: str :param desc: sort results by descending order (as opposed to ascending order) :type desc: 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: MetaAnalysisList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_get_with_http_info(nested, ids, page, page_size, name, search, description, sort, desc, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_get_with_http_info(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, ids : Annotated[Optional[conlist(StrictStr)], Field(description="choose the specific ids you wish to get")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of meta-analyses # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - list all runnable specification, studyset, annotation bundles # 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': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + 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 meta_analyses_get_with_http_info( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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[MetaAnalysisList]: + """GET a list of meta-analyses - >>> thread = api.meta_analyses_get_with_http_info(nested, ids, page, page_size, name, search, description, sort, desc, async_req=True) - >>> result = thread.get() + list all runnable specification, studyset, annotation bundles :param nested: show nested component instead of id :type nested: bool @@ -727,4231 +1311,5868 @@ def meta_analyses_get_with_http_info(self, nested : Annotated[Optional[StrictBoo :type sort: str :param desc: sort results by descending order (as opposed to ascending order) :type desc: 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(MetaAnalysisList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'nested', - 'ids', - 'page', - 'page_size', - 'name', - 'search', - 'description', - 'sort', - 'desc' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _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 meta_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('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - - if _params.get('ids') is not None: # noqa: E501 - _query_params.append(('ids', _params['ids'])) - _collection_formats['ids'] = 'multi' - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + 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_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'])) + @validate_call + def meta_analyses_get_without_preload_content( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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 meta-analyses - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + list all runnable specification, studyset, annotation bundles - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + :param nested: show nested component instead of id + :type nested: bool + :param ids: choose the specific ids you wish to get + :type ids: List[str] + :param page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: 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._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _meta_analyses_get_serialize( + self, + nested, + ids, + page, + page_size, + name, + search, + description, + sort, + desc, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'ids': 'multi', + } - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + _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 nested is not None: + + _query_params.append(('nested', nested)) + + if ids is not None: + + _query_params.append(('ids', ids)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if search is not None: + + _query_params.append(('search', search)) + + if description is not None: + + _query_params.append(('description', description)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if desc is not None: + + _query_params.append(('desc', desc)) + # 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/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "MetaAnalysisList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analyses', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-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 meta_analyses_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """GET meta-analysis information # noqa: E501 - get a meta-analysis (specification, annotation, and 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.meta_analyses_id_get(id, nested, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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, + ) -> MetaAnalysisReturn: + """GET meta-analysis information + + get a meta-analysis (specification, annotation, and studyset) :param id: (required) :type id: str :param nested: show nested component instead of id :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_get_with_http_info(id, nested, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET meta-analysis information # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - get a meta-analysis (specification, annotation, and 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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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[MetaAnalysisReturn]: + """GET meta-analysis information - >>> thread = api.meta_analyses_id_get_with_http_info(id, nested, async_req=True) - >>> result = thread.get() + get a meta-analysis (specification, annotation, and studyset) :param id: (required) :type id: str :param nested: show nested component instead of id :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analyses_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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 meta-analysis information + + get a meta-analysis (specification, annotation, and studyset) + + :param id: (required) + :type id: str + :param nested: show nested component instead of id + :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._meta_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 meta_analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 _meta_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "MetaAnalysisReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-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 meta_analyses_id_put(self, id : StrictStr, meta_analysis : Optional[MetaAnalysis] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """Update a meta-analysis # noqa: E501 - update an existing meta-analysis (that has not yet been run) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_id_put(id, meta_analysis, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_id_put( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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, + ) -> MetaAnalysisReturn: + """Update a meta-analysis + + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str :param meta_analysis: :type meta_analysis: MetaAnalysis - :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_put_with_http_info(id, meta_analysis, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_put_with_http_info(self, id : StrictStr, meta_analysis : Optional[MetaAnalysis] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a meta-analysis # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing meta-analysis (that has not yet been run) # 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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_put_with_http_info( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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[MetaAnalysisReturn]: + """Update a meta-analysis - >>> thread = api.meta_analyses_id_put_with_http_info(id, meta_analysis, async_req=True) - >>> result = thread.get() + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str :param meta_analysis: :type meta_analysis: MetaAnalysis - :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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', - 'meta_analysis' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analyses_id_put_without_preload_content( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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 a meta-analysis + + update an existing meta-analysis (that has not yet been run) + + :param id: (required) + :type id: str + :param meta_analysis: + :type meta_analysis: MetaAnalysis + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _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 meta_analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 _meta_analyses_id_put_serialize( + self, + id, + meta_analysis, + _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['meta_analysis'] is not None: - _body_params = _params['meta_analysis'] + if meta_analysis is not None: + _body_params = meta_analysis + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "MetaAnalysisReturn", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/meta-analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/meta-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 meta_analyses_post(self, meta_analysis_post_body : Optional[MetaAnalysisPostBody] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """Create a new meta-analysis # noqa: E501 - create a new specification, studyset, annotation bundle # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_post(meta_analysis_post_body, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_post( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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, + ) -> MetaAnalysisReturn: + """Create a new meta-analysis + + create a new specification, studyset, annotation bundle :param meta_analysis_post_body: :type meta_analysis_post_body: MetaAnalysisPostBody - :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_post_with_http_info(meta_analysis_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_post_with_http_info(self, meta_analysis_post_body : Optional[MetaAnalysisPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new meta-analysis # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new specification, studyset, annotation bundle # 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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 meta_analyses_post_with_http_info( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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[MetaAnalysisReturn]: + """Create a new meta-analysis - >>> thread = api.meta_analyses_post_with_http_info(meta_analysis_post_body, async_req=True) - >>> result = thread.get() + create a new specification, studyset, annotation bundle :param meta_analysis_post_body: :type meta_analysis_post_body: MetaAnalysisPostBody - :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'meta_analysis_post_body' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _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 meta_analyses_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['meta_analysis_post_body'] is not None: - _body_params = _params['meta_analysis_post_body'] - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+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 = { + _response_types_map: Dict[str, Optional[str]] = { '200': "MetaAnalysisReturn", '400': "MetaAnalysesGet400Response", '422': "MetaAnalysesGet400Response", '500': "MetaAnalysesGet400Response", } - - return self.api_client.call_api( - '/meta-analyses', '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 meta_analysis_results_get(self, meta_analysis_id : Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = None, **kwargs) -> ResultList: # 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 meta_analyses_post_without_preload_content( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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 new meta-analysis - >>> thread = api.meta_analysis_results_get(meta_analysis_id, async_req=True) - >>> result = thread.get() + create a new specification, studyset, annotation bundle - :param meta_analysis_id: search for results with this meta-analysis id - :type meta_analysis_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param meta_analysis_post_body: + :type meta_analysis_post_body: MetaAnalysisPostBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: ResultList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_get_with_http_info(meta_analysis_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _meta_analyses_post_serialize( + self, + meta_analysis_post_body, + _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 meta_analysis_post_body is not None: + _body_params = meta_analysis_post_body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) + + # 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] = [ + 'JSON-Web-Token' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/meta-analyses', + 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_arguments - def meta_analysis_results_get_with_http_info(self, meta_analysis_id : Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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.meta_analysis_results_get_with_http_info(meta_analysis_id, async_req=True) - >>> result = thread.get() + + @validate_call + def meta_analysis_results_get( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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, + ) -> ResultList: + """Your GET endpoint + :param meta_analysis_id: search for results with this meta-analysis id :type meta_analysis_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(ResultList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultList", + } + 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 meta_analysis_results_get_with_http_info( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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[ResultList]: + """Your GET endpoint - _params = locals() - _all_params = [ - 'meta_analysis_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + :param meta_analysis_id: search for results with this meta-analysis id + :type meta_analysis_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._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultList", + } + 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 meta_analysis_results_get_without_preload_content( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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 meta_analysis_id: search for results with this meta-analysis id + :type meta_analysis_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._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_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 meta_analysis_results_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultList", + } + 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 _meta_analysis_results_get_serialize( + self, + meta_analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('meta_analysis_id') is not None: # noqa: E501 - _query_params.append(('meta_analysis_id', _params['meta_analysis_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 meta_analysis_id is not None: + + _query_params.append(('meta_analysis_id', meta_analysis_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': "ResultList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analysis-results', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-analysis-results', + 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 meta_analysis_results_id_get(self, id : StrictStr, **kwargs) -> ResultReturn: # 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.meta_analysis_results_id_get(id, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analysis_results_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, + ) -> ResultReturn: + """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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_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': "ResultReturn", + } + 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 meta_analysis_results_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[ResultReturn]: + """Your GET endpoint - >>> thread = api.meta_analysis_results_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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_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': "ResultReturn", + } + 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 meta_analysis_results_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._meta_analysis_results_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 meta_analysis_results_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 _meta_analysis_results_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': "ResultReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analysis-results/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-analysis-results/{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 meta_analysis_results_id_put(self, id : StrictStr, result : Optional[Result] = None, **kwargs) -> ResultReturn: # 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.meta_analysis_results_id_put(id, result, async_req=True) - >>> result = thread.get() + + @validate_call + def meta_analysis_results_id_put( + self, + id: StrictStr, + result: Optional[Result] = 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, + ) -> ResultReturn: + """ + :param id: (required) :type id: str :param result: :type result: Result - :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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_id_put_with_http_info(id, result, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_id_put_with_http_info(self, id : StrictStr, result : Optional[Result] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _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': "ResultReturn", + } + 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 meta_analysis_results_id_put_with_http_info( + self, + id: StrictStr, + result: Optional[Result] = 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[ResultReturn]: + """ - >>> thread = api.meta_analysis_results_id_put_with_http_info(id, result, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param result: :type result: Result - :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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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', - 'result' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analysis_results_id_put_without_preload_content( + self, + id: StrictStr, + result: Optional[Result] = 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 result: + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _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 meta_analysis_results_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 _meta_analysis_results_id_put_serialize( + self, + id, + 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 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['result'] is not None: - _body_params = _params['result'] + if result is not None: + _body_params = result + # 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', 'multipart/form-data'])) - 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', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token', 'upload_key'] # noqa: E501 - - _response_types_map = { - '200': "ResultReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token', + 'upload_key' + ] - return self.api_client.call_api( - '/meta-analysis-results/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/meta-analysis-results/{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 meta_analysis_results_post(self, result_init : Optional[ResultInit] = None, **kwargs) -> ResultReturn: # 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.meta_analysis_results_post(result_init, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analysis_results_post( + self, + result_init: Optional[ResultInit] = 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, + ) -> ResultReturn: + """ + :param result_init: :type result_init: ResultInit - :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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_post_with_http_info(result_init, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_post_with_http_info(self, result_init : Optional[ResultInit] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _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': "ResultReturn", + } + 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 meta_analysis_results_post_with_http_info( + self, + result_init: Optional[ResultInit] = 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[ResultReturn]: + """ - >>> thread = api.meta_analysis_results_post_with_http_info(result_init, async_req=True) - >>> result = thread.get() :param result_init: :type result_init: ResultInit - :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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 = [ - 'result_init' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analysis_results_post_without_preload_content( + self, + result_init: Optional[ResultInit] = 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 result_init: + :type result_init: ResultInit + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analysis_results_post_serialize( + result_init=result_init, + _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 meta_analysis_results_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 _meta_analysis_results_post_serialize( + self, + result_init, + _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['result_init'] is not None: - _body_params = _params['result_init'] + if result_init is not None: + _body_params = result_init + # 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', 'upload_key'] # noqa: E501 - - _response_types_map = { - '200': "ResultReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token', + 'upload_key' + ] - return self.api_client.call_api( - '/meta-analysis-results', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/meta-analysis-results', + 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')) - - @validate_arguments - def neurovault_collections_get(self, **kwargs) -> None: # noqa: E501 - """Get neurovault collections # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.neurovault_collections_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. - :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 neurovault_collections_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get neurovault collections # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.neurovault_collections_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 - :param _request_timeout: timeout setting 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: None - """ - - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _host=_host, + _request_auth=_request_auth ) - # 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 neurovault_collections_get" % _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 - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/neurovault-collections', '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 neurovault_collections_id_get(self, id : StrictStr, **kwargs) -> NeurovaultCollectionReturn: # 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.neurovault_collections_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_collections_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_id_get_with_http_info(self, id : StrictStr, **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 + @validate_call + def projects_get( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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, + ) -> ProjectList: + """Your GET endpoint - >>> thread = api.neurovault_collections_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 page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param user_id: user id you want to filter on + :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. + 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(NeurovaultCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + 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 neurovault_collections_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 = [] - # 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': "NeurovaultCollectionReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", } - - return self.api_client.call_api( - '/neurovault-collections/{id}', 'GET', - _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 neurovault_collections_id_put(self, id : StrictStr, **kwargs) -> NeurovaultCollectionReturn: # 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.neurovault_collections_id_put(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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_collections_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_id_put_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_id_put_with_http_info(self, id : StrictStr, **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 + ).data + + + @validate_call + def projects_get_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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[ProjectList]: + """Your GET endpoint - >>> thread = api.neurovault_collections_id_put_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 page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param user_id: user id you want to filter on + :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. + 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(NeurovaultCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + 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 neurovault_collections_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 - # 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': "NeurovaultCollectionReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", } - - return self.api_client.call_api( - '/neurovault-collections/{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 neurovault_collections_post(self, neurovault_collection : Optional[NeurovaultCollection] = None, **kwargs) -> None: # noqa: E501 - """Create neurovault collection # 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.neurovault_collections_post(neurovault_collection, async_req=True) - >>> result = thread.get() - - :param neurovault_collection: - :type neurovault_collection: NeurovaultCollection - :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: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_collections_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_post_with_http_info(neurovault_collection, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_post_with_http_info(self, neurovault_collection : Optional[NeurovaultCollection] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create neurovault collection # 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.neurovault_collections_post_with_http_info(neurovault_collection, async_req=True) - >>> result = thread.get() - - :param neurovault_collection: - :type neurovault_collection: NeurovaultCollection - :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: None - """ - - _params = locals() - - _all_params = [ - 'neurovault_collection' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - - # 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 neurovault_collections_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['neurovault_collection'] is not None: - _body_params = _params['neurovault_collection'] - - # 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 = {} - - return self.api_client.call_api( - '/neurovault-collections', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + 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 neurovault_files_get(self, **kwargs) -> NeurovaultFileList: # 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 projects_get_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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 - >>> thread = api.neurovault_files_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultFileList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_get_with_http_info(self, **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.neurovault_files_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 + :param page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param user_id: user id you want to filter on + :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. + 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(NeurovaultFileList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + 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 neurovault_files_get" % _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 - # 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': "NeurovaultFileList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", } - - return self.api_client.call_api( - '/neurovault-files', '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 neurovault_files_id_get(self, id : StrictStr, **kwargs) -> NeurovaultFileReturn: # 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.neurovault_files_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultFileReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_id_get_with_http_info(self, id : StrictStr, **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.neurovault_files_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. - :param _request_auth: set to override the 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(NeurovaultFileReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response + + + def _projects_get_serialize( + self, + page, + page_size, + name, + search, + description, + sort, + desc, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - # 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 neurovault_files_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _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 = {} - if _params['id']: - _path_params['id'] = _params['id'] - - # process the query parameters - _query_params = [] + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if search is not None: + + _query_params.append(('search', search)) + + if description is not None: + + _query_params.append(('description', description)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + 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 = [] # noqa: E501 - _response_types_map = { - '200': "NeurovaultFileReturn", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/neurovault-files/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + 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 neurovault_files_id_put(self, id : StrictStr, collection_id : Optional[StrictStr] = None, exception : Optional[StrictStr] = None, traceback : Optional[StrictStr] = None, status : Optional[StrictStr] = None, image_id : Optional[StrictStr] = None, name : Optional[StrictStr] = None, url : Optional[StrictStr] = None, **kwargs) -> NeurovaultFileReturn: # 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.neurovault_files_id_put(id, collection_id, exception, traceback, status, image_id, name, url, async_req=True) - >>> result = thread.get() - :param id: (required) - :type id: str - :param collection_id: - :type collection_id: str - :param exception: - :type exception: str - :param traceback: - :type traceback: str - :param status: - :type status: str - :param image_id: - :type image_id: str - :param name: - :type name: str - :param url: - :type url: 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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultFileReturn + @validate_call + def projects_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: """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_id_put_with_http_info(id, collection_id, exception, traceback, status, image_id, name, url, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_id_put_with_http_info(self, id : StrictStr, collection_id : Optional[StrictStr] = None, exception : Optional[StrictStr] = None, traceback : Optional[StrictStr] = None, status : Optional[StrictStr] = None, image_id : Optional[StrictStr] = None, name : Optional[StrictStr] = None, url : Optional[StrictStr] = 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.neurovault_files_id_put_with_http_info(id, collection_id, exception, traceback, status, image_id, name, url, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param collection_id: - :type collection_id: str - :param exception: - :type exception: str - :param traceback: - :type traceback: str - :param status: - :type status: str - :param image_id: - :type image_id: str - :param name: - :type name: str - :param url: - :type url: 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(NeurovaultFileReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id', - 'collection_id', - 'exception', - 'traceback', - 'status', - 'image_id', - 'name', - 'url' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_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 neurovault_files_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 = {} - if _params['collection_id']: - _form_params.append(('collection_id', _params['collection_id'])) - - if _params['exception']: - _form_params.append(('exception', _params['exception'])) - - if _params['traceback']: - _form_params.append(('traceback', _params['traceback'])) - - if _params['status']: - _form_params.append(('status', _params['status'])) - - if _params['image_id']: - _form_params.append(('image_id', _params['image_id'])) - - if _params['name']: - _form_params.append(('name', _params['name'])) - - if _params['url']: - _form_params.append(('url', _params['url'])) - - # 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 - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "NeurovaultFileReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': None, } - - return self.api_client.call_api( - '/neurovault-files/{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 neurovault_files_post(self, neurovault_file : Optional[NeurovaultFile] = None, **kwargs) -> NeurovaultFileReturn: # 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.neurovault_files_post(neurovault_file, async_req=True) - >>> result = thread.get() - - :param neurovault_file: - :type neurovault_file: NeurovaultFile - :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: NeurovaultFileReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_post_with_http_info(neurovault_file, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_post_with_http_info(self, neurovault_file : Optional[NeurovaultFile] = 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.neurovault_files_post_with_http_info(neurovault_file, async_req=True) - >>> result = thread.get() - - :param neurovault_file: - :type neurovault_file: NeurovaultFile - :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(NeurovaultFileReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'neurovault_file' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) - - # 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 neurovault_files_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['neurovault_file'] is not None: - _body_params = _params['neurovault_file'] - - # 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': "NeurovaultFileReturn", - } - - return self.api_client.call_api( - '/neurovault-files', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + 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 projects_get(self, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = None, **kwargs) -> ProjectList: # 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.projects_get(page, page_size, name, search, description, sort, desc, user_id, async_req=True) - >>> result = thread.get() - - :param page: page of results - :type page: int - :param page_size: number of elements to return on a page - :type page_size: int - :param name: search the name field for a term - :type name: str - :param search: search for entries that contain the substring - :type search: str - :param description: search description field for a term - :type description: str - :param sort: Parameter to sort results on - :type sort: str - :param desc: sort results by descending order (as opposed to ascending order) - :type desc: bool - :param user_id: user id you want to filter on - :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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ProjectList + ).data + + + @validate_call + def projects_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]: """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_get_with_http_info(page, page_size, name, search, description, sort, desc, user_id, **kwargs) # noqa: E501 - - @validate_arguments - def projects_get_with_http_info(self, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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.projects_get_with_http_info(page, page_size, name, search, description, sort, desc, user_id, async_req=True) - >>> result = thread.get() - - :param page: page of results - :type page: int - :param page_size: number of elements to return on a page - :type page_size: int - :param name: search the name field for a term - :type name: str - :param search: search for entries that contain the substring - :type search: str - :param description: search description field for a term - :type description: str - :param sort: Parameter to sort results on - :type sort: str - :param desc: sort results by descending order (as opposed to ascending order) - :type desc: bool - :param user_id: user id you want to filter on - :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 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. + 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(ProjectList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'page', - 'page_size', - 'name', - 'search', - 'description', - 'sort', - 'desc', - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_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 projects_get" % _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 + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} + @validate_call + def projects_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: + """ - # process the query parameters - _query_params = [] - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + :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._projects_id_delete_serialize( + id=id, + _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': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + def _projects_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + _host = None - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + _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 + if id is not None: + _path_params['id'] = id + # process the query parameters # 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': "ProjectList", - } - return self.api_client.call_api( - '/projects', 'GET', - _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='/projects/{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 projects_id_delete(self, id : StrictStr, **kwargs) -> None: # 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 projects_id_get( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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, + ) -> ProjectReturn: + """Your GET endpoint - >>> thread = api.projects_id_delete(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 info: display additional information about a nested relationship without displaying fully nested object + :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. - 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 projects_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + 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': "ProjectReturn", + } + 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 projects_id_get_with_http_info( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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[ProjectReturn]: + """Your GET endpoint - >>> thread = api.projects_id_delete_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 info: display additional information about a nested relationship without displaying fully nested object + :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. + 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._projects_id_get_serialize( + id=id, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 projects_id_get_without_preload_content( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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 info: display additional information about a nested relationship without displaying fully nested object + :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._projects_id_get_serialize( + id=id, + 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 projects_id_delete" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_id_get_serialize( + self, + id, + info, + _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 = [] + 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 - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/projects/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, + # 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='/projects/{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 projects_id_get(self, id : StrictStr, info : Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = None, **kwargs) -> ProjectReturn: # 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.projects_id_get(id, info, async_req=True) - >>> result = thread.get() + @validate_call + def projects_id_put( + self, + id: StrictStr, + project: Optional[Project] = 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, + ) -> ProjectReturn: + """ + :param id: (required) :type id: str - :param info: display additional information about a nested relationship without displaying fully nested object - :type info: bool - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param project: + :type project: Project :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_get_with_http_info(id, info, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_get_with_http_info(self, id : StrictStr, info : Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + project=project, + _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': "ProjectReturn", + } + 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 projects_id_put_with_http_info( + self, + id: StrictStr, + project: Optional[Project] = 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[ProjectReturn]: + """ - >>> thread = api.projects_id_get_with_http_info(id, info, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param info: display additional information about a nested relationship without displaying fully nested object - :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 project: + :type project: Project :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def projects_id_put_without_preload_content( + self, + id: StrictStr, + project: Optional[Project] = 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 project: + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._projects_id_put_serialize( + id=id, + project=project, + _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 projects_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_id_put_serialize( + self, + id, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) + _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 - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + if project is not None: + _body_params = project + + # 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 + # 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 - _response_types_map = { - '200': "ProjectReturn", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/projects/{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 projects_id_put(self, id : StrictStr, project : Optional[Project] = None, **kwargs) -> ProjectReturn: # 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.projects_id_put(id, project, async_req=True) - >>> result = thread.get() - :param id: (required) - :type id: str + @validate_call + def projects_post( + self, + project: Optional[Project] = 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, + ) -> ProjectReturn: + """ + + :param project: :type project: Project - :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_put_with_http_info(id, project, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_put_with_http_info(self, id : StrictStr, project : Optional[Project] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _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': "ProjectReturn", + } + 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 projects_post_with_http_info( + self, + project: Optional[Project] = 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[ProjectReturn]: + """ - >>> thread = api.projects_id_put_with_http_info(id, project, async_req=True) - >>> result = thread.get() - :param id: (required) - :type id: str :param project: :type project: Project - :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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', - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def projects_post_without_preload_content( + self, + project: Optional[Project] = 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 project: + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._projects_post_serialize( + project=project, + _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 projects_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_post_serialize( + self, + project, + _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['project'] is not None: - _body_params = _params['project'] + if project is not None: + _body_params = project + # 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': "ProjectReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/projects', + 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 projects_post(self, project : Optional[Project] = None, **kwargs) -> ProjectReturn: # 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.projects_post(project, async_req=True) - >>> result = thread.get() - :param project: - :type project: Project - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def specifications_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, + ) -> SpecificationList: + """Get a list of Specifications + + list of meta-analysis specifications + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_post_with_http_info(project, **kwargs) # noqa: E501 + """ # noqa: E501 - @validate_arguments - def projects_post_with_http_info(self, project : Optional[Project] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + _param = self._specifications_get_serialize( + _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': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_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[SpecificationList]: + """Get a list of Specifications - >>> thread = api.projects_post_with_http_info(project, async_req=True) - >>> result = thread.get() + list of meta-analysis specifications + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_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 Specifications + + list of meta-analysis specifications - :param project: - :type project: Project - :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._specifications_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'project' - ] - _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': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 projects_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _specifications_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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['project'] is not None: - _body_params = _params['project'] + # 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', + 'application/problem+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 # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "ProjectReturn", - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/projects', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/specifications', + 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 specifications_get(self, **kwargs) -> SpecificationList: # noqa: E501 - """Get a list of Specifications # noqa: E501 - list of meta-analysis specifications # 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 specifications_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, + ) -> SpecificationReturn: + """Get information about a Specification - >>> thread = api.specifications_get(async_req=True) - >>> result = thread.get() + get a meta-analysis specification - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :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. - If the method is called asynchronously, - returns the request thread. - :rtype: SpecificationList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def specifications_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get a list of Specifications # noqa: E501 - - list of meta-analysis specifications # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_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._specifications_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': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 specifications_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[SpecificationReturn]: + """Get information about a Specification + + get a meta-analysis specification + + :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. + 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(SpecificationList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_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': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def specifications_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 information about a Specification + + get a meta-analysis specification + + :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._specifications_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 specifications_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 _specifications_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "SpecificationList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/specifications', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/specifications/{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 specifications_id_get(self, id : StrictStr, **kwargs) -> SpecificationReturn: # noqa: E501 - """Get information about a Specification # noqa: E501 - get a meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_id_get(id, async_req=True) - >>> result = thread.get() + @validate_call + def specifications_id_put( + self, + id: StrictStr, + specification: Optional[Specification] = 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, + ) -> SpecificationReturn: + """Update Meta-Analysis specification + + update an existing meta analysis specification :param id: (required) :type id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param specification: + :type specification: Specification :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get information about a Specification # noqa: E501 + """ # noqa: E501 + + _param = self._specifications_id_put_serialize( + id=id, + specification=specification, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - get a meta-analysis specification # 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': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 specifications_id_put_with_http_info( + self, + id: StrictStr, + specification: Optional[Specification] = 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[SpecificationReturn]: + """Update Meta-Analysis specification - >>> thread = api.specifications_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + update an existing meta analysis specification :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 specification: + :type specification: Specification :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_id_put_serialize( + id=id, + specification=specification, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 specifications_id_put_without_preload_content( + self, + id: StrictStr, + specification: Optional[Specification] = 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 Meta-Analysis specification + + update an existing meta analysis specification + + :param id: (required) + :type id: str + :param specification: + :type specification: Specification + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_id_put_serialize( + id=id, + specification=specification, + _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 specifications_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 _specifications_id_put_serialize( + self, + id, + specification, + _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 specification is not None: + _body_params = specification + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 + # 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 - _response_types_map = { - '200': "SpecificationReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/specifications/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/specifications/{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 specifications_id_put(self, id : StrictStr, specification : Optional[Specification] = None, **kwargs) -> SpecificationReturn: # noqa: E501 - """Update Meta-Analysis specification # noqa: E501 - update an existing meta analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_id_put(id, specification, async_req=True) - >>> result = thread.get() - :param id: (required) - :type id: str - :param specification: - :type specification: Specification - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def specifications_post( + self, + specification_post_body: Optional[SpecificationPostBody] = 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, + ) -> SpecificationReturn: + """Create a Specification + + create a new meta-analysis specification + + :param specification_post_body: + :type specification_post_body: SpecificationPostBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_id_put_with_http_info(id, specification, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_id_put_with_http_info(self, id : StrictStr, specification : Optional[Specification] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update Meta-Analysis specification # noqa: E501 + """ # noqa: E501 + + _param = self._specifications_post_serialize( + specification_post_body=specification_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing meta analysis specification # 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': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 specifications_post_with_http_info( + self, + specification_post_body: Optional[SpecificationPostBody] = 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[SpecificationReturn]: + """Create a Specification - >>> thread = api.specifications_id_put_with_http_info(id, specification, async_req=True) - >>> result = thread.get() + create a new meta-analysis specification - :param id: (required) - :type id: str - :param specification: - :type specification: Specification - :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 specification_post_body: + :type specification_post_body: SpecificationPostBody :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_post_serialize( + specification_post_body=specification_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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', - 'specification' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def specifications_post_without_preload_content( + self, + specification_post_body: Optional[SpecificationPostBody] = 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 Specification + + create a new meta-analysis specification + + :param specification_post_body: + :type specification_post_body: SpecificationPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_post_serialize( + specification_post_body=specification_post_body, + _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 specifications_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 _specifications_post_serialize( + self, + specification_post_body, + _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['specification'] is not None: - _body_params = _params['specification'] + if specification_post_body is not None: + _body_params = specification_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "SpecificationReturn", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/specifications/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/specifications', + 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_call + def studysets_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, + ) -> StudysetList: + """Get a list of Studysets - @validate_arguments - def specifications_post(self, specification_post_body : Optional[SpecificationPostBody] = None, **kwargs) -> SpecificationReturn: # noqa: E501 - """Create a Specification # noqa: E501 + get a list of serialized/referenced studysets - create a new meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 - >>> thread = api.specifications_post(specification_post_body, async_req=True) - >>> result = thread.get() + get a list of serialized/referenced studysets - :param specification_post_body: - :type specification_post_body: SpecificationPostBody - :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_post_with_http_info(specification_post_body, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - @validate_arguments - def specifications_post_with_http_info(self, specification_post_body : Optional[SpecificationPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a Specification # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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, + ) - create a new meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_post_with_http_info(specification_post_body, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_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 Studysets + + get a list of serialized/referenced studysets - :param specification_post_body: - :type specification_post_body: SpecificationPostBody - :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._studysets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'specification_post_body' - ] - _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': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studysets_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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['specification_post_body'] is not None: - _body_params = _params['specification_post_body'] + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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 # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "SpecificationReturn", - '400': "MetaAnalysesGet400Response", - '422': None, - '500': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/specifications', 'POST', - _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_get(self, **kwargs) -> StudysetList: # noqa: E501 - """Get a list of Studysets # noqa: E501 - get a list of serialized/referenced 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(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. - :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(**kwargs) # noqa: E501 - - @validate_arguments - def studysets_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get a list of Studysets # noqa: E501 - - get a list of serialized/referenced 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(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 + @validate_call + def studysets_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, + ) -> StudysetReturn: + """Get information about a Studyset + + get a single serialized/referenced 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. + 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 = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._studysets_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 studysets_get" % _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 - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 - - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "StudysetList", - '400': "MetaAnalysesGet400Response", + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", } - - return self.api_client.call_api( - '/studysets', 'GET', - _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 studysets_id_get(self, id : StrictStr, **kwargs) -> StudysetReturn: # noqa: E501 - """Get information about a Studyset # noqa: E501 - - get a single serialized/referenced studyset # 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 studysets_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[StudysetReturn]: + """Get information about a Studyset - >>> thread = api.studysets_id_get(id, async_req=True) - >>> result = thread.get() + get a single serialized/referenced 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: 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, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 studysets_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get information about a Studyset # noqa: E501 - get a single serialized/referenced 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 studysets_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 information about a Studyset - >>> thread = api.studysets_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + get a single serialized/referenced 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: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._studysets_id_get_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'id' - ] - _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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 studysets_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studysets_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + 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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # 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 : Optional[Studyset] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """Update a Studyset # noqa: E501 - update an existing serialized/referenced 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, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_id_put( + self, + id: StrictStr, + studyset: Optional[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, + ) -> StudysetReturn: + """Update a Studyset + + update an existing serialized/referenced studyset :param id: (required) :type id: str :param studyset: :type studyset: Studyset - :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, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_put_with_http_info(self, id : StrictStr, studyset : Optional[Studyset] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a Studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset=studyset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing serialized/referenced 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", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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: Optional[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[StudysetReturn]: + """Update a Studyset - >>> thread = api.studysets_id_put_with_http_info(id, studyset, async_req=True) - >>> result = thread.get() + update an existing serialized/referenced studyset :param id: (required) :type id: str :param studyset: :type studyset: Studyset - :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=studyset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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' - ] - _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: Optional[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: + """Update a Studyset + + update an existing serialized/referenced studyset + + :param id: (required) + :type id: str + :param studyset: + :type studyset: Studyset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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=studyset, + _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", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_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'] is not None: - _body_params = _params['studyset'] + if studyset is not None: + _body_params = studyset + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': None, - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _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_post_body : Optional[StudysetPostBody] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """Create a new Studyset # noqa: E501 - create a new serialized/referenced 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_post_body, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_post( + self, + studyset_post_body: Optional[StudysetPostBody] = 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: + """Create a new Studyset + + create a new serialized/referenced studyset :param studyset_post_body: :type studyset_post_body: StudysetPostBody - :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_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_post_with_http_info(self, studyset_post_body : Optional[StudysetPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new Studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_post_body=studyset_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new serialized/referenced 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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body: Optional[StudysetPostBody] = 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]: + """Create a new Studyset - >>> thread = api.studysets_post_with_http_info(studyset_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced studyset :param studyset_post_body: :type studyset_post_body: StudysetPostBody - :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_post_body=studyset_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body' - ] - _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_post_body: Optional[StudysetPostBody] = 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 new Studyset + + create a new serialized/referenced studyset + + :param studyset_post_body: + :type studyset_post_body: StudysetPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_post_body=studyset_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body, + _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_post_body'] is not None: - _body_params = _params['studyset_post_body'] + if studyset_post_body is not None: + _body_params = studyset_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _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/neurosynth_compose_sdk/api/default_api.py b/neurosynth_compose_sdk/api/default_api.py index c7c66f8..b09f2ac 100644 --- a/neurosynth_compose_sdk/api/default_api.py +++ b/neurosynth_compose_sdk/api/default_api.py @@ -3,1009 +3,826 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 - from typing import Optional - -from neurosynth_compose_sdk.models.neurostore_study_list import NeurostoreStudyList -from neurosynth_compose_sdk.models.neurostore_study_return import NeurostoreStudyReturn +from typing_extensions import Annotated from neurosynth_compose_sdk.models.studyset_reference_list import StudysetReferenceList from neurosynth_compose_sdk.models.studyset_reference_return import StudysetReferenceReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class DefaultApi(object): +class DefaultApi: """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 meta_analyses_id_delete(self, id : StrictStr, **kwargs) -> None: # 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.meta_analyses_id_delete(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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None + @validate_call + def meta_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: """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_delete_with_http_info(self, id : StrictStr, **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.meta_analyses_id_delete_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: None - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_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 meta_analyses_id_delete" % _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 - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/meta-analyses/{id}', 'DELETE', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + _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, - 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 neurostore_studies_get(self, **kwargs) -> NeurostoreStudyList: # 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 + ).data + + + @validate_call + def meta_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]: + """ - >>> thread = api.neurostore_studies_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurostoreStudyList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurostore_studies_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurostore_studies_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def neurostore_studies_get_with_http_info(self, **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.neurostore_studies_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 + :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. + 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(NeurostoreStudyList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_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 neurostore_studies_get" % _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 - # 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': "NeurostoreStudyList", + _response_types_map: Dict[str, Optional[str]] = { + '200': None, } - - return self.api_client.call_api( - '/neurostore-studies', 'GET', - _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 neurostore_studies_id_get(self, id : StrictStr, **kwargs) -> NeurostoreStudyReturn: # 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.neurostore_studies_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurostoreStudyReturn + @validate_call + def meta_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: """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurostore_studies_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurostore_studies_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurostore_studies_id_get_with_http_info(self, id : StrictStr, **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.neurostore_studies_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(NeurostoreStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._meta_analyses_id_delete_serialize( + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'id' - ] - _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': None, + } + 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 neurostore_studies_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analyses_id_delete_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + 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 - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "NeurostoreStudyReturn", - } - return self.api_client.call_api( - '/neurostore-studies/{id}', 'GET', - _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='/meta-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 neurostore_studies_id_put(self, id : StrictStr, **kwargs) -> NeurostoreStudyReturn: # 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.neurostore_studies_id_put(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 + @validate_call + def studyset_references_get( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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, + ) -> StudysetReferenceList: + """Your GET endpoint + + + + :param nested: show nested component instead of id + :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. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurostoreStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurostore_studies_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurostore_studies_id_put_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurostore_studies_id_put_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._studyset_references_get_serialize( + nested=nested, + _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': "StudysetReferenceList", + } + 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 studyset_references_get_with_http_info( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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[StudysetReferenceList]: + """Your GET endpoint - >>> thread = api.neurostore_studies_id_put_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 nested: show nested component instead of id + :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. + 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(NeurostoreStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._studyset_references_get_serialize( + 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 neurostore_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 - # 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( - ['multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "NeurostoreStudyReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReferenceList", } - - return self.api_client.call_api( - '/neurostore-studies/{id}', 'PUT', - _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 neurostore_studies_post(self, **kwargs) -> NeurostoreStudyReturn: # 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 studyset_references_get_without_preload_content( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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 - >>> thread = api.neurostore_studies_post(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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurostoreStudyReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurostore_studies_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurostore_studies_post_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def neurostore_studies_post_with_http_info(self, **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.neurostore_studies_post_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 + :param nested: show nested component instead of id + :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. + 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(NeurostoreStudyReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._studyset_references_get_serialize( + nested=nested, + _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': "StudysetReferenceList", + } + 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 neurostore_studies_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studyset_references_get_serialize( + self, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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 = [] + 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' + ] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list # authentication setting - _auth_settings = ['JSON-Web-Token'] # noqa: E501 - - _response_types_map = { - '200': "NeurostoreStudyReturn", - } + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/neurostore-studies', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studyset-references', + 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')) - - @validate_arguments - def studyset_references_get(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> StudysetReferenceList: # noqa: E501 - """Your GET endpoint # noqa: E501 - - # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _host=_host, + _request_auth=_request_auth + ) - >>> thread = api.studyset_references_get(nested, async_req=True) - >>> result = thread.get() - :param nested: show nested component instead of id - :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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: StudysetReferenceList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studyset_references_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studyset_references_get_with_http_info(nested, **kwargs) # noqa: E501 - @validate_arguments - def studyset_references_get_with_http_info(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # 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 studyset_references_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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, + ) -> StudysetReferenceReturn: + """Your GET endpoint - >>> thread = api.studyset_references_get_with_http_info(nested, async_req=True) - >>> result = thread.get() + :param id: (required) + :type id: str :param nested: show nested component instead of id :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(StudysetReferenceList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'nested' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._studyset_references_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 studyset_references_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('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['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 - - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { - '200': "StudysetReferenceList", + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReferenceReturn", } - - return self.api_client.call_api( - '/studyset-references', 'GET', - _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 studyset_references_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> StudysetReferenceReturn: # 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 + ).data + + + @validate_call + def studyset_references_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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[StudysetReferenceReturn]: + """Your GET endpoint - >>> thread = api.studyset_references_id_get(id, nested, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param nested: show nested component instead of id :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: StudysetReferenceReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the studyset_references_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.studyset_references_id_get_with_http_info(id, nested, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._studyset_references_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - @validate_arguments - def studyset_references_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReferenceReturn", + } + 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, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.studyset_references_id_get_with_http_info(id, nested, async_req=True) - >>> result = thread.get() + @validate_call + def studyset_references_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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 nested: show nested component instead of id :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(StudysetReferenceReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._studyset_references_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'id', - 'nested' - ] - _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': "StudysetReferenceReturn", + } + 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 studyset_references_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studyset_references_id_get_serialize( + self, + id, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['id'] + _host = None + _collection_formats: Dict[str, str] = { + } - # process the query parameters - _query_params = [] - 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 + 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': "StudysetReferenceReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/studyset-references/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/studyset-references/{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 + ) + + diff --git a/neurosynth_compose_sdk/api/get_api.py b/neurosynth_compose_sdk/api/get_api.py index 9c8dc6e..bfc2553 100644 --- a/neurosynth_compose_sdk/api/get_api.py +++ b/neurosynth_compose_sdk/api/get_api.py @@ -3,34 +3,27 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 typing import Optional - +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated from neurosynth_compose_sdk.models.annotation_list import AnnotationList from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn -from neurosynth_compose_sdk.models.neurovault_file_list import NeurovaultFileList -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn from neurosynth_compose_sdk.models.project_list import ProjectList from neurosynth_compose_sdk.models.project_return import ProjectReturn from neurosynth_compose_sdk.models.result_list import ResultList @@ -40,309 +33,568 @@ from neurosynth_compose_sdk.models.studyset_list import StudysetList from neurosynth_compose_sdk.models.studyset_return import StudysetReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class GetApi(object): +class GetApi: """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 annotations_get(self, **kwargs) -> AnnotationList: # noqa: E501 - """GET a list of annotations # noqa: E501 - get a list of serialized/referenced annotations # 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """GET a list of annotations - >>> thread = api.annotations_get(async_req=True) - >>> result = thread.get() + get a list of serialized/referenced annotations - :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(**kwargs) # noqa: E501 - - @validate_arguments - def annotations_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of annotations # noqa: E501 - - get a list of serialized/referenced annotations # 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(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._annotations_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationList", + '400': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """GET a list of annotations + + get a list of serialized/referenced annotations + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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 - _params = locals() + _param = self._annotations_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': "AnnotationList", + '400': "MetaAnalysesGet400Response", + } + 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 annotations_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 annotations + + get a list of serialized/referenced annotations + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + _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", + '400': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationList", - '400': "MetaAnalysesGet400Response", - } + # 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_get(self, id : StrictStr, **kwargs) -> AnnotationReturn: # noqa: E501 - """GET information about an annotation # noqa: E501 - get a single 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, async_req=True) - >>> result = thread.get() + + @validate_call + def annotations_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, + ) -> AnnotationReturn: + """GET information about an annotation + + get a single 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: 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, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """GET information about an annotation # noqa: E501 - - get a single 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, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._annotations_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': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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]: + """GET information about an annotation + + get a single 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: tuple(AnnotationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._annotations_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': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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_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 information about an annotation + + get a single 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_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 annotations_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnnotationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "AnnotationReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # 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 meta_analyses_get(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, ids : Annotated[Optional[conlist(StrictStr)], Field(description="choose the specific ids you wish to get")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, **kwargs) -> MetaAnalysisList: # noqa: E501 - """GET a list of meta-analyses # noqa: E501 - list all runnable specification, studyset, annotation bundles # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_get(nested, ids, page, page_size, name, search, description, sort, desc, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_get( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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, + ) -> MetaAnalysisList: + """GET a list of meta-analyses + + list all runnable specification, studyset, annotation bundles :param nested: show nested component instead of id :type nested: bool @@ -362,32 +614,87 @@ def meta_analyses_get(self, nested : Annotated[Optional[StrictBool], Field(descr :type sort: str :param desc: sort results by descending order (as opposed to ascending order) :type desc: 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: MetaAnalysisList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_get_with_http_info(nested, ids, page, page_size, name, search, description, sort, desc, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_get_with_http_info(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, ids : Annotated[Optional[conlist(StrictStr)], Field(description="choose the specific ids you wish to get")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of meta-analyses # noqa: E501 - - list all runnable specification, studyset, annotation bundles # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.meta_analyses_get_with_http_info(nested, ids, page, page_size, name, search, description, sort, desc, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + 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 meta_analyses_get_with_http_info( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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[MetaAnalysisList]: + """GET a list of meta-analyses + + list all runnable specification, studyset, annotation bundles :param nested: show nested component instead of id :type nested: bool @@ -407,1095 +714,1182 @@ def meta_analyses_get_with_http_info(self, nested : Annotated[Optional[StrictBoo :type sort: str :param desc: sort results by descending order (as opposed to ascending order) :type desc: 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(MetaAnalysisList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'nested', - 'ids', - 'page', - 'page_size', - 'name', - 'search', - 'description', - 'sort', - 'desc' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _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 meta_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('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - - if _params.get('ids') is not None: # noqa: E501 - _query_params.append(('ids', _params['ids'])) - _collection_formats['ids'] = 'multi' - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + 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_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'])) + @validate_call + def meta_analyses_get_without_preload_content( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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 meta-analyses - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + list all runnable specification, studyset, annotation bundles - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + :param nested: show nested component instead of id + :type nested: bool + :param ids: choose the specific ids you wish to get + :type ids: List[str] + :param page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: 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._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _meta_analyses_get_serialize( + self, + nested, + ids, + page, + page_size, + name, + search, + description, + sort, + desc, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'ids': 'multi', + } - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + _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 nested is not None: + + _query_params.append(('nested', nested)) + + if ids is not None: + + _query_params.append(('ids', ids)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if search is not None: + + _query_params.append(('search', search)) + + if description is not None: + + _query_params.append(('description', description)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if desc is not None: + + _query_params.append(('desc', desc)) + # 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/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "MetaAnalysisList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analyses', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-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 meta_analyses_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """GET meta-analysis information # noqa: E501 - get a meta-analysis (specification, annotation, and 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 meta_analyses_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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, + ) -> MetaAnalysisReturn: + """GET meta-analysis information - >>> thread = api.meta_analyses_id_get(id, nested, async_req=True) - >>> result = thread.get() + get a meta-analysis (specification, annotation, and studyset) :param id: (required) :type id: str :param nested: show nested component instead of id :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_get_with_http_info(id, nested, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET meta-analysis information # noqa: E501 - - get a meta-analysis (specification, annotation, and 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.meta_analyses_id_get_with_http_info(id, nested, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._meta_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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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[MetaAnalysisReturn]: + """GET meta-analysis information + + get a meta-analysis (specification, annotation, and studyset) :param id: (required) :type id: str :param nested: show nested component instead of id :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analyses_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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 meta-analysis information + + get a meta-analysis (specification, annotation, and studyset) + + :param id: (required) + :type id: str + :param nested: show nested component instead of id + :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._meta_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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analyses_id_get_serialize( + self, + id, + nested, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] - if _params.get('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - + 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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "MetaAnalysisReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-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 meta_analysis_results_get(self, meta_analysis_id : Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = None, **kwargs) -> ResultList: # 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 meta_analysis_results_get( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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, + ) -> ResultList: + """Your GET endpoint - >>> thread = api.meta_analysis_results_get(meta_analysis_id, async_req=True) - >>> result = thread.get() :param meta_analysis_id: search for results with this meta-analysis id :type meta_analysis_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: ResultList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_get_with_http_info(meta_analysis_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - @validate_arguments - def meta_analysis_results_get_with_http_info(self, meta_analysis_id : Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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 + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultList", + } + 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 meta_analysis_results_get_with_http_info( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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[ResultList]: + """Your GET endpoint - >>> thread = api.meta_analysis_results_get_with_http_info(meta_analysis_id, async_req=True) - >>> result = thread.get() :param meta_analysis_id: search for results with this meta-analysis id :type meta_analysis_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(ResultList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'meta_analysis_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_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 meta_analysis_results_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('meta_analysis_id') is not None: # noqa: E501 - _query_params.append(('meta_analysis_id', _params['meta_analysis_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 - - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "ResultList", } - - return self.api_client.call_api( - '/meta-analysis-results', 'GET', - _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 meta_analysis_results_id_get(self, id : StrictStr, **kwargs) -> ResultReturn: # 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.meta_analysis_results_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_id_get_with_http_info(id, **kwargs) # noqa: E501 + ) - @validate_arguments - def meta_analysis_results_id_get_with_http_info(self, id : StrictStr, **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 + @validate_call + def meta_analysis_results_get_without_preload_content( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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 - >>> thread = api.meta_analysis_results_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 meta_analysis_id: search for results with this meta-analysis id + :type meta_analysis_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. + 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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'id' - ] - _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': "ResultList", + } + 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 meta_analysis_results_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analysis_results_get_serialize( + self, + meta_analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 - _query_params = [] + if meta_analysis_id is not None: + + _query_params.append(('meta_analysis_id', meta_analysis_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': "ResultReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analysis-results/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-analysis-results', + 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')) - - @validate_arguments - def neurovault_collections_get(self, **kwargs) -> None: # noqa: E501 - """Get neurovault collections # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.neurovault_collections_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. - :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 neurovault_collections_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get neurovault collections # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.neurovault_collections_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 - :param _request_timeout: timeout setting 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: None - """ - - _params = locals() - - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _host=_host, + _request_auth=_request_auth ) - # 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 neurovault_collections_get" % _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 - # authentication setting - _auth_settings = [] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/neurovault-collections', '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 neurovault_collections_id_get(self, id : StrictStr, **kwargs) -> NeurovaultCollectionReturn: # 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 meta_analysis_results_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, + ) -> ResultReturn: + """Your GET endpoint - >>> thread = api.neurovault_collections_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: NeurovaultCollectionReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_collections_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_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': "ResultReturn", + } + 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 meta_analysis_results_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[ResultReturn]: + """Your GET endpoint - >>> thread = api.neurovault_collections_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(NeurovaultCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analysis_results_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 neurovault_collections_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 = [] - # 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': "NeurovaultCollectionReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", } - - return self.api_client.call_api( - '/neurovault-collections/{id}', 'GET', - _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 neurovault_files_get(self, **kwargs) -> NeurovaultFileList: # 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 meta_analysis_results_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 - >>> thread = api.neurovault_files_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultFileList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_get_with_http_info(self, **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.neurovault_files_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 + :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. + 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(NeurovaultFileList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._meta_analysis_results_id_get_serialize( + id=id, + _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': "ResultReturn", + } + 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 neurovault_files_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analysis_results_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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': "NeurovaultFileList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/neurovault-files', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-analysis-results/{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 neurovault_files_id_get(self, id : StrictStr, **kwargs) -> NeurovaultFileReturn: # 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.neurovault_files_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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultFileReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_id_get_with_http_info(self, id : StrictStr, **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 + @validate_call + def projects_get( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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, + ) -> ProjectList: + """Your GET endpoint - >>> thread = api.neurovault_files_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 page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param user_id: user id you want to filter on + :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. + 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(NeurovaultFileReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + 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 neurovault_files_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 = [] - # 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': "NeurovaultFileReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", } - - return self.api_client.call_api( - '/neurovault-files/{id}', 'GET', - _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 projects_get(self, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = None, **kwargs) -> ProjectList: # 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 + ).data + + + @validate_call + def projects_get_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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[ProjectList]: + """Your GET endpoint - >>> thread = api.projects_get(page, page_size, name, search, description, sort, desc, user_id, async_req=True) - >>> result = thread.get() :param page: page of results :type page: int @@ -1513,31 +1907,83 @@ def projects_get(self, page : Annotated[Optional[conint(strict=True, ge=0)], Fie :type desc: bool :param user_id: user id you want to filter on :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: ProjectList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_get_with_http_info(page, page_size, name, search, description, sort, desc, user_id, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - @validate_arguments - def projects_get_with_http_info(self, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + } + 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, + ) - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.projects_get_with_http_info(page, page_size, name, search, description, sort, desc, user_id, async_req=True) - >>> result = thread.get() + @validate_call + def projects_get_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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 page: page of results :type page: int @@ -1555,818 +2001,1455 @@ def projects_get_with_http_info(self, page : Annotated[Optional[conint(strict=Tr :type desc: bool :param user_id: user id you want to filter on :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(ProjectList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'page', - 'page_size', - 'name', - 'search', - 'description', - 'sort', - 'desc', - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + 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 projects_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_get_serialize( + self, + page, + page_size, + name, + search, + description, + sort, + desc, + user_id, + _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('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - 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('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) - - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) - - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) - - if _params.get('user_id') is not None: # noqa: E501 - _query_params.append(('user_id', _params['user_id'])) - + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if search is not None: + + _query_params.append(('search', search)) + + if description is not None: + + _query_params.append(('description', description)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + 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': "ProjectList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + 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 projects_id_get(self, id : StrictStr, info : Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = None, **kwargs) -> ProjectReturn: # 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.projects_id_get(id, info, async_req=True) - >>> result = thread.get() + + @validate_call + def projects_id_get( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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, + ) -> ProjectReturn: + """Your GET endpoint + + + :param id: (required) + :type id: str + :param info: display additional information about a nested relationship without displaying fully nested object + :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._projects_id_get_serialize( + id=id, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 projects_id_get_with_http_info( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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[ProjectReturn]: + """Your GET endpoint + :param id: (required) :type id: str :param info: display additional information about a nested relationship without displaying fully nested object :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_get_with_http_info(id, info, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 projects_id_get_with_http_info(self, id : StrictStr, info : Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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 + @validate_call + def projects_id_get_without_preload_content( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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 - >>> thread = api.projects_id_get_with_http_info(id, info, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param info: display additional information about a nested relationship without displaying fully nested object :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + info=info, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'id', - 'info' - ] - _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': "ProjectReturn", + } + 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 projects_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _projects_id_get_serialize( + self, + id, + info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + if id is not None: + _path_params['id'] = id # process the query parameters - _query_params = [] - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) - + 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': "ProjectReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/projects/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{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 specifications_get(self, **kwargs) -> SpecificationList: # noqa: E501 - """Get a list of Specifications # noqa: E501 - list of meta-analysis specifications # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_get(async_req=True) - >>> result = thread.get() - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + @validate_call + def specifications_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, + ) -> SpecificationList: + """Get a list of Specifications + + list of meta-analysis specifications + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: SpecificationList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def specifications_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get a list of Specifications # noqa: E501 - - list of meta-analysis specifications # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_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._specifications_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_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[SpecificationList]: + """Get a list of Specifications + + list of meta-analysis specifications + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(SpecificationList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._specifications_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': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_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 Specifications + + list of meta-analysis specifications + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_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 specifications_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 _specifications_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "SpecificationList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/specifications', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/specifications', + 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 specifications_id_get(self, id : StrictStr, **kwargs) -> SpecificationReturn: # noqa: E501 - """Get information about a Specification # noqa: E501 - get a meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def specifications_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, + ) -> SpecificationReturn: + """Get information about a Specification + + get a meta-analysis specification :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get information about a Specification # noqa: E501 - - get a meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._specifications_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': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 specifications_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[SpecificationReturn]: + """Get information about a Specification + + get a meta-analysis specification :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_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': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 specifications_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 information about a Specification + + get a meta-analysis specification + + :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._specifications_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 specifications_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 _specifications_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "SpecificationReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/specifications/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/specifications/{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_get(self, **kwargs) -> StudysetList: # noqa: E501 - """Get a list of Studysets # noqa: E501 - get a list of serialized/referenced 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(async_req=True) - >>> result = thread.get() + @validate_call + def studysets_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, + ) -> StudysetList: + """Get a list of Studysets + + get a list of serialized/referenced studysets - :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(**kwargs) # noqa: E501 - - @validate_arguments - def studysets_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get a list of Studysets # noqa: E501 - - get a list of serialized/referenced 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(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._studysets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 serialized/referenced studysets + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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)) - """ + """ # noqa: E501 - _params = locals() + _param = self._studysets_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': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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 studysets_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 Studysets + + get a list of serialized/referenced studysets + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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 studysets_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studysets_get_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - 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_get(self, id : StrictStr, **kwargs) -> StudysetReturn: # noqa: E501 - """Get information about a Studyset # noqa: E501 - get a single serialized/referenced 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_get(id, async_req=True) - >>> result = thread.get() + @validate_call + def studysets_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, + ) -> StudysetReturn: + """Get information about a Studyset + + get a single serialized/referenced 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: 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, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get information about a Studyset # noqa: E501 - - get a single serialized/referenced 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_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 information about a Studyset + + get a single serialized/referenced 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: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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_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 information about a Studyset + + get a single serialized/referenced 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_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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 studysets_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _studysets_id_get_serialize( + self, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + 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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # 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 + ) + + diff --git a/neurosynth_compose_sdk/api/meta_analyses_api.py b/neurosynth_compose_sdk/api/meta_analyses_api.py index 0b1e5c4..1fc6e76 100644 --- a/neurosynth_compose_sdk/api/meta_analyses_api.py +++ b/neurosynth_compose_sdk/api/meta_analyses_api.py @@ -3,27 +3,23 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 typing import Optional - +from pydantic import Field, StrictBool, StrictStr +from typing import List, Optional +from typing_extensions import Annotated from neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis from neurosynth_compose_sdk.models.meta_analysis_list import MetaAnalysisList from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody @@ -33,36 +29,52 @@ from neurosynth_compose_sdk.models.result_list import ResultList from neurosynth_compose_sdk.models.result_return import ResultReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class MetaAnalysesApi(object): +class MetaAnalysesApi: """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 meta_analyses_get(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, ids : Annotated[Optional[conlist(StrictStr)], Field(description="choose the specific ids you wish to get")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, **kwargs) -> MetaAnalysisList: # noqa: E501 - """GET a list of meta-analyses # noqa: E501 - list all runnable specification, studyset, annotation bundles # 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 meta_analyses_get( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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, + ) -> MetaAnalysisList: + """GET a list of meta-analyses - >>> thread = api.meta_analyses_get(nested, ids, page, page_size, name, search, description, sort, desc, async_req=True) - >>> result = thread.get() + list all runnable specification, studyset, annotation bundles :param nested: show nested component instead of id :type nested: bool @@ -82,32 +94,87 @@ def meta_analyses_get(self, nested : Annotated[Optional[StrictBool], Field(descr :type sort: str :param desc: sort results by descending order (as opposed to ascending order) :type desc: 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: MetaAnalysisList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_get_with_http_info(nested, ids, page, page_size, name, search, description, sort, desc, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_get_with_http_info(self, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, ids : Annotated[Optional[conlist(StrictStr)], Field(description="choose the specific ids you wish to get")] = None, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET a list of meta-analyses # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - list all runnable specification, studyset, annotation bundles # 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': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + 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 meta_analyses_get_with_http_info( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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[MetaAnalysisList]: + """GET a list of meta-analyses - >>> thread = api.meta_analyses_get_with_http_info(nested, ids, page, page_size, name, search, description, sort, desc, async_req=True) - >>> result = thread.get() + list all runnable specification, studyset, annotation bundles :param nested: show nested component instead of id :type nested: bool @@ -127,1159 +194,2203 @@ def meta_analyses_get_with_http_info(self, nested : Annotated[Optional[StrictBoo :type sort: str :param desc: sort results by descending order (as opposed to ascending order) :type desc: 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(MetaAnalysisList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'nested', - 'ids', - 'page', - 'page_size', - 'name', - 'search', - 'description', - 'sort', - 'desc' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _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 meta_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('nested') is not None: # noqa: E501 - _query_params.append(('nested', _params['nested'])) - - if _params.get('ids') is not None: # noqa: E501 - _query_params.append(('ids', _params['ids'])) - _collection_formats['ids'] = 'multi' - - if _params.get('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + 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_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'])) + @validate_call + def meta_analyses_get_without_preload_content( + self, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, + ids: Annotated[Optional[List[StrictStr]], Field(description="choose the specific ids you wish to get")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = 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 meta-analyses - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + list all runnable specification, studyset, annotation bundles - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) + :param nested: show nested component instead of id + :type nested: bool + :param ids: choose the specific ids you wish to get + :type ids: List[str] + :param page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: 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._meta_analyses_get_serialize( + nested=nested, + ids=ids, + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisList", + '400': "MetaAnalysesGet400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _meta_analyses_get_serialize( + self, + nested, + ids, + page, + page_size, + name, + search, + description, + sort, + desc, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'ids': 'multi', + } - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + _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 nested is not None: + + _query_params.append(('nested', nested)) + + if ids is not None: + + _query_params.append(('ids', ids)) + + if page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if search is not None: + + _query_params.append(('search', search)) + + if description is not None: + + _query_params.append(('description', description)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if desc is not None: + + _query_params.append(('desc', desc)) + # 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/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "MetaAnalysisList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analyses', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-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 meta_analyses_id_get(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """GET meta-analysis information # noqa: E501 - get a meta-analysis (specification, annotation, and 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.meta_analyses_id_get(id, nested, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_id_get( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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, + ) -> MetaAnalysisReturn: + """GET meta-analysis information + + get a meta-analysis (specification, annotation, and studyset) :param id: (required) :type id: str :param nested: show nested component instead of id :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_get_with_http_info(id, nested, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_get_with_http_info(self, id : StrictStr, nested : Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """GET meta-analysis information # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_id_get_serialize( + id=id, + nested=nested, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - get a meta-analysis (specification, annotation, and 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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_get_with_http_info( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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[MetaAnalysisReturn]: + """GET meta-analysis information - >>> thread = api.meta_analyses_id_get_with_http_info(id, nested, async_req=True) - >>> result = thread.get() + get a meta-analysis (specification, annotation, and studyset) :param id: (required) :type id: str :param nested: show nested component instead of id :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_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': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_get_without_preload_content( + self, + id: StrictStr, + nested: Annotated[Optional[StrictBool], Field(description="show nested component instead of id")] = 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 meta-analysis information + + get a meta-analysis (specification, annotation, and studyset) + + :param id: (required) + :type id: str + :param nested: show nested component instead of id + :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._meta_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 meta_analyses_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 _meta_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "MetaAnalysisReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analyses/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-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 meta_analyses_id_put(self, id : StrictStr, meta_analysis : Optional[MetaAnalysis] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """Update a meta-analysis # noqa: E501 - update an existing meta-analysis (that has not yet been run) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_id_put(id, meta_analysis, async_req=True) - >>> result = thread.get() + + @validate_call + def meta_analyses_id_put( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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, + ) -> MetaAnalysisReturn: + """Update a meta-analysis + + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str :param meta_analysis: :type meta_analysis: MetaAnalysis - :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_put_with_http_info(id, meta_analysis, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_put_with_http_info(self, id : StrictStr, meta_analysis : Optional[MetaAnalysis] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a meta-analysis # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing meta-analysis (that has not yet been run) # 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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_put_with_http_info( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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[MetaAnalysisReturn]: + """Update a meta-analysis - >>> thread = api.meta_analyses_id_put_with_http_info(id, meta_analysis, async_req=True) - >>> result = thread.get() + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str :param meta_analysis: :type meta_analysis: MetaAnalysis - :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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', - 'meta_analysis' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analyses_id_put_without_preload_content( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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 a meta-analysis + + update an existing meta-analysis (that has not yet been run) + + :param id: (required) + :type id: str + :param meta_analysis: + :type meta_analysis: MetaAnalysis + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _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 meta_analyses_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 _meta_analyses_id_put_serialize( + self, + id, + meta_analysis, + _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['meta_analysis'] is not None: - _body_params = _params['meta_analysis'] + if meta_analysis is not None: + _body_params = meta_analysis + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "MetaAnalysisReturn", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/meta-analyses/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/meta-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 meta_analyses_post(self, meta_analysis_post_body : Optional[MetaAnalysisPostBody] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """Create a new meta-analysis # noqa: E501 - create a new specification, studyset, annotation bundle # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_post(meta_analysis_post_body, async_req=True) - >>> result = thread.get() + + @validate_call + def meta_analyses_post( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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, + ) -> MetaAnalysisReturn: + """Create a new meta-analysis + + create a new specification, studyset, annotation bundle :param meta_analysis_post_body: :type meta_analysis_post_body: MetaAnalysisPostBody - :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_post_with_http_info(meta_analysis_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_post_with_http_info(self, meta_analysis_post_body : Optional[MetaAnalysisPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new meta-analysis # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new specification, studyset, annotation bundle # 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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 meta_analyses_post_with_http_info( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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[MetaAnalysisReturn]: + """Create a new meta-analysis - >>> thread = api.meta_analyses_post_with_http_info(meta_analysis_post_body, async_req=True) - >>> result = thread.get() + create a new specification, studyset, annotation bundle :param meta_analysis_post_body: :type meta_analysis_post_body: MetaAnalysisPostBody - :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'meta_analysis_post_body' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analyses_post_without_preload_content( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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 new meta-analysis + + create a new specification, studyset, annotation bundle + + :param meta_analysis_post_body: + :type meta_analysis_post_body: MetaAnalysisPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _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 meta_analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 _meta_analyses_post_serialize( + self, + meta_analysis_post_body, + _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['meta_analysis_post_body'] is not None: - _body_params = _params['meta_analysis_post_body'] + if meta_analysis_post_body is not None: + _body_params = meta_analysis_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "MetaAnalysisReturn", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/meta-analyses', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/meta-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 meta_analysis_results_get(self, meta_analysis_id : Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = None, **kwargs) -> ResultList: # 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.meta_analysis_results_get(meta_analysis_id, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analysis_results_get( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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, + ) -> ResultList: + """Your GET endpoint + :param meta_analysis_id: search for results with this meta-analysis id :type meta_analysis_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: ResultList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_get_with_http_info(meta_analysis_id, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_get_with_http_info(self, meta_analysis_id : Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_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': "ResultList", + } + 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 meta_analysis_results_get_with_http_info( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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[ResultList]: + """Your GET endpoint - >>> thread = api.meta_analysis_results_get_with_http_info(meta_analysis_id, async_req=True) - >>> result = thread.get() :param meta_analysis_id: search for results with this meta-analysis id :type meta_analysis_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(ResultList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultList", + } + 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 = [ - 'meta_analysis_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def meta_analysis_results_get_without_preload_content( + self, + meta_analysis_id: Annotated[Optional[StrictStr], Field(description="search for results with this meta-analysis id")] = 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 meta_analysis_id: search for results with this meta-analysis id + :type meta_analysis_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._meta_analysis_results_get_serialize( + meta_analysis_id=meta_analysis_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 meta_analysis_results_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultList", + } + 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 _meta_analysis_results_get_serialize( + self, + meta_analysis_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the query parameters - _query_params = [] - if _params.get('meta_analysis_id') is not None: # noqa: E501 - _query_params.append(('meta_analysis_id', _params['meta_analysis_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 meta_analysis_id is not None: + + _query_params.append(('meta_analysis_id', meta_analysis_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': "ResultList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analysis-results', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-analysis-results', + 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 meta_analysis_results_id_get(self, id : StrictStr, **kwargs) -> ResultReturn: # 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.meta_analysis_results_id_get(id, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analysis_results_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, + ) -> ResultReturn: + """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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_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': "ResultReturn", + } + 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 meta_analysis_results_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[ResultReturn]: + """Your GET endpoint - >>> thread = api.meta_analysis_results_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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_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': "ResultReturn", + } + 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 meta_analysis_results_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._meta_analysis_results_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 meta_analysis_results_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 _meta_analysis_results_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': "ResultReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/meta-analysis-results/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/meta-analysis-results/{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 meta_analysis_results_id_put(self, id : StrictStr, result : Optional[Result] = None, **kwargs) -> ResultReturn: # 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.meta_analysis_results_id_put(id, result, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analysis_results_id_put( + self, + id: StrictStr, + result: Optional[Result] = 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, + ) -> ResultReturn: + """ + :param id: (required) :type id: str :param result: :type result: Result - :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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_id_put_with_http_info(id, result, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_id_put_with_http_info(self, id : StrictStr, result : Optional[Result] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _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': "ResultReturn", + } + 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 meta_analysis_results_id_put_with_http_info( + self, + id: StrictStr, + result: Optional[Result] = 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[ResultReturn]: + """ - >>> thread = api.meta_analysis_results_id_put_with_http_info(id, result, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param result: :type result: Result - :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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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', - 'result' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def meta_analysis_results_id_put_without_preload_content( + self, + id: StrictStr, + result: Optional[Result] = 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 result: + :type result: Result + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _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 meta_analysis_results_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 _meta_analysis_results_id_put_serialize( + self, + id, + 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 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['result'] is not None: - _body_params = _params['result'] + if result is not None: + _body_params = result + # 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', 'multipart/form-data'])) - 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', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['JSON-Web-Token', 'upload_key'] # noqa: E501 - - _response_types_map = { - '200': "ResultReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token', + 'upload_key' + ] - return self.api_client.call_api( - '/meta-analysis-results/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/meta-analysis-results/{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 meta_analysis_results_post(self, result_init : Optional[ResultInit] = None, **kwargs) -> ResultReturn: # 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.meta_analysis_results_post(result_init, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analysis_results_post( + self, + result_init: Optional[ResultInit] = 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, + ) -> ResultReturn: + """ + :param result_init: :type result_init: ResultInit - :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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_post_with_http_info(result_init, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_post_with_http_info(self, result_init : Optional[ResultInit] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _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': "ResultReturn", + } + 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 meta_analysis_results_post_with_http_info( + self, + result_init: Optional[ResultInit] = 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[ResultReturn]: + """ - >>> thread = api.meta_analysis_results_post_with_http_info(result_init, async_req=True) - >>> result = thread.get() :param result_init: :type result_init: ResultInit - :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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 = [ - 'result_init' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def meta_analysis_results_post_without_preload_content( + self, + result_init: Optional[ResultInit] = 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 result_init: + :type result_init: ResultInit + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analysis_results_post_serialize( + result_init=result_init, + _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 meta_analysis_results_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 _meta_analysis_results_post_serialize( + self, + result_init, + _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['result_init'] is not None: - _body_params = _params['result_init'] + if result_init is not None: + _body_params = result_init + # 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', 'upload_key'] # noqa: E501 - - _response_types_map = { - '200': "ResultReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token', + 'upload_key' + ] - return self.api_client.call_api( - '/meta-analysis-results', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/meta-analysis-results', + 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/neurosynth_compose_sdk/api/post_api.py b/neurosynth_compose_sdk/api/post_api.py index bc1e6bd..4910f3c 100644 --- a/neurosynth_compose_sdk/api/post_api.py +++ b/neurosynth_compose_sdk/api/post_api.py @@ -3,32 +3,25 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 typing import Optional - from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.meta_analysis_post_body import MetaAnalysisPostBody from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.models.neurovault_collection import NeurovaultCollection -from neurosynth_compose_sdk.models.neurovault_file import NeurovaultFile -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn from neurosynth_compose_sdk.models.result_init import ResultInit @@ -38,1190 +31,1698 @@ from neurosynth_compose_sdk.models.studyset_post_body import StudysetPostBody from neurosynth_compose_sdk.models.studyset_return import StudysetReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class PostApi(object): +class PostApi: """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 annotations_post(self, annotation_post_body : Optional[AnnotationPostBody] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Create a new Annotation # noqa: E501 - create a new serialized/referenced 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, + annotation_post_body: Optional[AnnotationPostBody] = 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: + """Create a new Annotation - >>> thread = api.annotations_post(annotation_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced annotation :param annotation_post_body: :type annotation_post_body: AnnotationPostBody - :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(annotation_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_post_with_http_info(self, annotation_post_body : Optional[AnnotationPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new Annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_post_serialize( + annotation_post_body=annotation_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new serialized/referenced 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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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, + annotation_post_body: Optional[AnnotationPostBody] = 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]: + """Create a new Annotation - >>> thread = api.annotations_post_with_http_info(annotation_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced annotation :param annotation_post_body: :type annotation_post_body: AnnotationPostBody - :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( + annotation_post_body=annotation_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'annotation_post_body' - ] - _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, + annotation_post_body: Optional[AnnotationPostBody] = 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 new Annotation + + create a new serialized/referenced annotation + + :param annotation_post_body: + :type annotation_post_body: AnnotationPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + annotation_post_body=annotation_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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, + annotation_post_body, + _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['annotation_post_body'] is not None: - _body_params = _params['annotation_post_body'] + if annotation_post_body is not None: + _body_params = annotation_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _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 meta_analyses_post(self, meta_analysis_post_body : Optional[MetaAnalysisPostBody] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """Create a new meta-analysis # noqa: E501 - create a new specification, studyset, annotation bundle # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_post(meta_analysis_post_body, async_req=True) - >>> result = thread.get() + @validate_call + def meta_analyses_post( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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, + ) -> MetaAnalysisReturn: + """Create a new meta-analysis + + create a new specification, studyset, annotation bundle :param meta_analysis_post_body: :type meta_analysis_post_body: MetaAnalysisPostBody - :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_post_with_http_info(meta_analysis_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_post_with_http_info(self, meta_analysis_post_body : Optional[MetaAnalysisPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new meta-analysis # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new specification, studyset, annotation bundle # 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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 meta_analyses_post_with_http_info( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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[MetaAnalysisReturn]: + """Create a new meta-analysis - >>> thread = api.meta_analyses_post_with_http_info(meta_analysis_post_body, async_req=True) - >>> result = thread.get() + create a new specification, studyset, annotation bundle :param meta_analysis_post_body: :type meta_analysis_post_body: MetaAnalysisPostBody - :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'meta_analysis_post_body' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def meta_analyses_post_without_preload_content( + self, + meta_analysis_post_body: Optional[MetaAnalysisPostBody] = 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 new meta-analysis + + create a new specification, studyset, annotation bundle + + :param meta_analysis_post_body: + :type meta_analysis_post_body: MetaAnalysisPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._meta_analyses_post_serialize( + meta_analysis_post_body=meta_analysis_post_body, + _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 meta_analyses_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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 _meta_analyses_post_serialize( + self, + meta_analysis_post_body, + _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['meta_analysis_post_body'] is not None: - _body_params = _params['meta_analysis_post_body'] + if meta_analysis_post_body is not None: + _body_params = meta_analysis_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "MetaAnalysisReturn", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/meta-analyses', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/meta-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 meta_analysis_results_post(self, result_init : Optional[ResultInit] = None, **kwargs) -> ResultReturn: # 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.meta_analysis_results_post(result_init, async_req=True) - >>> result = thread.get() + + @validate_call + def meta_analysis_results_post( + self, + result_init: Optional[ResultInit] = 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, + ) -> ResultReturn: + """ + :param result_init: :type result_init: ResultInit - :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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_post_with_http_info(result_init, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analysis_results_post_with_http_info(self, result_init : Optional[ResultInit] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _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': "ResultReturn", + } + 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 meta_analysis_results_post_with_http_info( + self, + result_init: Optional[ResultInit] = 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[ResultReturn]: + """ - >>> thread = api.meta_analysis_results_post_with_http_info(result_init, async_req=True) - >>> result = thread.get() :param result_init: :type result_init: ResultInit - :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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'result_init' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _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 meta_analysis_results_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['result_init'] is not None: - _body_params = _params['result_init'] - - # 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', 'upload_key'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '200': "ResultReturn", } - - return self.api_client.call_api( - '/meta-analysis-results', '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 neurovault_collections_post(self, neurovault_collection : Optional[NeurovaultCollection] = None, **kwargs) -> None: # noqa: E501 - """Create neurovault collection # 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 meta_analysis_results_post_without_preload_content( + self, + result_init: Optional[ResultInit] = 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: + """ - >>> thread = api.neurovault_collections_post(neurovault_collection, async_req=True) - >>> result = thread.get() - :param neurovault_collection: - :type neurovault_collection: NeurovaultCollection - :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: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_collections_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_post_with_http_info(neurovault_collection, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_collections_post_with_http_info(self, neurovault_collection : Optional[NeurovaultCollection] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create neurovault collection # 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.neurovault_collections_post_with_http_info(neurovault_collection, async_req=True) - >>> result = thread.get() - - :param neurovault_collection: - :type neurovault_collection: NeurovaultCollection - :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 result_init: + :type result_init: ResultInit :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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 - """ - - _params = locals() + """ # noqa: E501 + + _param = self._meta_analysis_results_post_serialize( + result_init=result_init, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'neurovault_collection' - ] - _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': "ResultReturn", + } + 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 neurovault_collections_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analysis_results_post_serialize( + self, + result_init, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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['neurovault_collection'] is not None: - _body_params = _params['neurovault_collection'] + if result_init is not None: + _body_params = result_init + + + # set the HTTP header `Accept` + 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 = {} + _auth_settings: List[str] = [ + 'JSON-Web-Token', + 'upload_key' + ] - return self.api_client.call_api( - '/neurovault-collections', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/meta-analysis-results', + 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 neurovault_files_post(self, neurovault_file : Optional[NeurovaultFile] = None, **kwargs) -> NeurovaultFileReturn: # 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.neurovault_files_post(neurovault_file, async_req=True) - >>> result = thread.get() - :param neurovault_file: - :type neurovault_file: NeurovaultFile - :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: NeurovaultFileReturn + @validate_call + def projects_post( + self, + project: Optional[Project] = 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, + ) -> ProjectReturn: """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_post_with_http_info(neurovault_file, **kwargs) # noqa: E501 - - @validate_arguments - def neurovault_files_post_with_http_info(self, neurovault_file : Optional[NeurovaultFile] = 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.neurovault_files_post_with_http_info(neurovault_file, async_req=True) - >>> result = thread.get() - - :param neurovault_file: - :type neurovault_file: NeurovaultFile - :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 project: + :type project: Project :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(NeurovaultFileReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'neurovault_file' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _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 neurovault_files_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['neurovault_file'] is not None: - _body_params = _params['neurovault_file'] - - # 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': "NeurovaultFileReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", } - - return self.api_client.call_api( - '/neurovault-files', '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 projects_post(self, project : Optional[Project] = None, **kwargs) -> ProjectReturn: # noqa: E501 - """ # 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 projects_post_with_http_info( + self, + project: Optional[Project] = 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[ProjectReturn]: + """ - >>> thread = api.projects_post(project, async_req=True) - >>> result = thread.get() :param project: :type project: Project - :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_post_with_http_info(project, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 projects_post_with_http_info(self, project : Optional[Project] = 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 + @validate_call + def projects_post_without_preload_content( + self, + project: Optional[Project] = 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: + """ - >>> thread = api.projects_post_with_http_info(project, async_req=True) - >>> result = thread.get() :param project: :type project: Project - :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'project' - ] - _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': "ProjectReturn", + } + 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 projects_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _projects_post_serialize( + self, + project, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _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['project'] is not None: - _body_params = _params['project'] + if project is not None: + _body_params = project + # 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': "ProjectReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/projects', + 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 specifications_post(self, specification_post_body : Optional[SpecificationPostBody] = None, **kwargs) -> SpecificationReturn: # noqa: E501 - """Create a Specification # noqa: E501 - create a new meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_post(specification_post_body, async_req=True) - >>> result = thread.get() + @validate_call + def specifications_post( + self, + specification_post_body: Optional[SpecificationPostBody] = 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, + ) -> SpecificationReturn: + """Create a Specification + + create a new meta-analysis specification :param specification_post_body: :type specification_post_body: SpecificationPostBody - :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_post_with_http_info(specification_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_post_with_http_info(self, specification_post_body : Optional[SpecificationPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a Specification # noqa: E501 + """ # noqa: E501 + + _param = self._specifications_post_serialize( + specification_post_body=specification_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new meta-analysis specification # 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': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 specifications_post_with_http_info( + self, + specification_post_body: Optional[SpecificationPostBody] = 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[SpecificationReturn]: + """Create a Specification - >>> thread = api.specifications_post_with_http_info(specification_post_body, async_req=True) - >>> result = thread.get() + create a new meta-analysis specification :param specification_post_body: :type specification_post_body: SpecificationPostBody - :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_post_serialize( + specification_post_body=specification_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'specification_post_body' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def specifications_post_without_preload_content( + self, + specification_post_body: Optional[SpecificationPostBody] = 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 Specification + + create a new meta-analysis specification + + :param specification_post_body: + :type specification_post_body: SpecificationPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_post_serialize( + specification_post_body=specification_post_body, + _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 specifications_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 _specifications_post_serialize( + self, + specification_post_body, + _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['specification_post_body'] is not None: - _body_params = _params['specification_post_body'] + if specification_post_body is not None: + _body_params = specification_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "SpecificationReturn", - '400': "MetaAnalysesGet400Response", - '422': None, - '500': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/specifications', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/specifications', + 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_post_body : Optional[StudysetPostBody] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """Create a new Studyset # noqa: E501 - create a new serialized/referenced 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_post_body, async_req=True) - >>> result = thread.get() + + @validate_call + def studysets_post( + self, + studyset_post_body: Optional[StudysetPostBody] = 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: + """Create a new Studyset + + create a new serialized/referenced studyset :param studyset_post_body: :type studyset_post_body: StudysetPostBody - :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_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_post_with_http_info(self, studyset_post_body : Optional[StudysetPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new Studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_post_body=studyset_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - create a new serialized/referenced 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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body: Optional[StudysetPostBody] = 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]: + """Create a new Studyset - >>> thread = api.studysets_post_with_http_info(studyset_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced studyset :param studyset_post_body: :type studyset_post_body: StudysetPostBody - :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_post_body=studyset_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body' - ] - _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_post_body: Optional[StudysetPostBody] = 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 new Studyset + + create a new serialized/referenced studyset + + :param studyset_post_body: + :type studyset_post_body: StudysetPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_post_body=studyset_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body, + _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_post_body'] is not None: - _body_params = _params['studyset_post_body'] + if studyset_post_body is not None: + _body_params = studyset_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _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/neurosynth_compose_sdk/api/projects_api.py b/neurosynth_compose_sdk/api/projects_api.py index d5c6b0e..ef405ca 100644 --- a/neurosynth_compose_sdk/api/projects_api.py +++ b/neurosynth_compose_sdk/api/projects_api.py @@ -3,60 +3,71 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_list import ProjectList from neurosynth_compose_sdk.models.project_return import ProjectReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class ProjectsApi(object): +class ProjectsApi: """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 projects_get(self, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = None, **kwargs) -> ProjectList: # 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 projects_get( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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, + ) -> ProjectList: + """Your GET endpoint - >>> thread = api.projects_get(page, page_size, name, search, description, sort, desc, user_id, async_req=True) - >>> result = thread.get() :param page: page of results :type page: int @@ -74,31 +85,83 @@ def projects_get(self, page : Annotated[Optional[conint(strict=True, ge=0)], Fie :type desc: bool :param user_id: user id you want to filter on :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: ProjectList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_get_with_http_info(page, page_size, name, search, description, sort, desc, user_id, **kwargs) # noqa: E501 - - @validate_arguments - def projects_get_with_http_info(self, page : Annotated[Optional[conint(strict=True, ge=0)], Field(description="page of results")] = None, page_size : Annotated[Optional[conint(strict=True, lt=30000, ge=1)], Field(description="number of elements to return on a page")] = None, name : Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, search : Annotated[Optional[constr(strict=True, min_length=1)], Field(description="search for entries that contain the substring")] = None, description : Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, sort : Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, desc : Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, user_id : Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + user_id=user_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': "ProjectList", + } + 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 projects_get_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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[ProjectList]: + """Your GET endpoint - >>> thread = api.projects_get_with_http_info(page, page_size, name, search, description, sort, desc, user_id, async_req=True) - >>> result = thread.get() :param page: page of results :type page: int @@ -116,699 +179,1325 @@ def projects_get_with_http_info(self, page : Annotated[Optional[conint(strict=Tr :type desc: bool :param user_id: user id you want to filter on :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(ProjectList, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'page', - 'page_size', - 'name', - 'search', - 'description', - 'sort', - 'desc', - 'user_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + 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 projects_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('page') is not None: # noqa: E501 - _query_params.append(('page', _params['page'])) - - if _params.get('page_size') is not None: # noqa: E501 - _query_params.append(('page_size', _params['page_size'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + } + 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('name') is not None: # noqa: E501 - _query_params.append(('name', _params['name'])) - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + @validate_call + def projects_get_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="page of results")] = None, + page_size: Annotated[Optional[Annotated[int, Field(lt=30000, strict=True, ge=1)]], Field(description="number of elements to return on a page")] = None, + name: Annotated[Optional[StrictStr], Field(description="search the name field for a term")] = None, + search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="search for entries that contain the substring")] = None, + description: Annotated[Optional[StrictStr], Field(description="search description field for a term")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Parameter to sort results on")] = None, + desc: Annotated[Optional[StrictBool], Field(description="sort results by descending order (as opposed to ascending order)")] = None, + user_id: Annotated[Optional[StrictStr], Field(description="user id you want to filter on")] = 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 - if _params.get('description') is not None: # noqa: E501 - _query_params.append(('description', _params['description'])) - if _params.get('sort') is not None: # noqa: E501 - _query_params.append(('sort', _params['sort'])) + :param page: page of results + :type page: int + :param page_size: number of elements to return on a page + :type page_size: int + :param name: search the name field for a term + :type name: str + :param search: search for entries that contain the substring + :type search: str + :param description: search description field for a term + :type description: str + :param sort: Parameter to sort results on + :type sort: str + :param desc: sort results by descending order (as opposed to ascending order) + :type desc: bool + :param user_id: user id you want to filter on + :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._projects_get_serialize( + page=page, + page_size=page_size, + name=name, + search=search, + description=description, + sort=sort, + desc=desc, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('desc') is not None: # noqa: E501 - _query_params.append(('desc', _params['desc'])) + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectList", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _projects_get_serialize( + self, + page, + page_size, + name, + search, + description, + sort, + desc, + 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 page is not None: + + _query_params.append(('page', page)) + + if page_size is not None: + + _query_params.append(('page_size', page_size)) + + if name is not None: + + _query_params.append(('name', name)) + + if search is not None: + + _query_params.append(('search', search)) + + if description is not None: + + _query_params.append(('description', description)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if desc is not None: + + _query_params.append(('desc', desc)) + + 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': "ProjectList", - } + # authentication setting + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/projects', + 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 projects_id_delete(self, id : StrictStr, **kwargs) -> None: # 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 projects_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: + """ - >>> thread = api.projects_id_delete(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: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_delete_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_delete_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_delete_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_delete_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': 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 projects_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]: + """ - >>> thread = api.projects_id_delete_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: None - """ + """ # noqa: E501 + + _param = self._projects_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 projects_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: + """ + + + :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._projects_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 projects_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 _projects_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( - '/projects/{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='/projects/{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 projects_id_get(self, id : StrictStr, info : Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = None, **kwargs) -> ProjectReturn: # 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.projects_id_get(id, info, async_req=True) - >>> result = thread.get() + @validate_call + def projects_id_get( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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, + ) -> ProjectReturn: + """Your GET endpoint + :param id: (required) :type id: str :param info: display additional information about a nested relationship without displaying fully nested object :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_get_with_http_info(id, info, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_get_with_http_info(self, id : StrictStr, info : Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Your GET endpoint # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + 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': "ProjectReturn", + } + 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 projects_id_get_with_http_info( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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[ProjectReturn]: + """Your GET endpoint - >>> thread = api.projects_id_get_with_http_info(id, info, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param info: display additional information about a nested relationship without displaying fully nested object :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._projects_id_get_serialize( + id=id, + 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': "ProjectReturn", + } + 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', - 'info' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def projects_id_get_without_preload_content( + self, + id: StrictStr, + info: Annotated[Optional[StrictBool], Field(description="display additional information about a nested relationship without displaying fully nested object")] = 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 info: display additional information about a nested relationship without displaying fully nested object + :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._projects_id_get_serialize( + id=id, + 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 projects_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_id_get_serialize( + self, + id, + info, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('info') is not None: # noqa: E501 - _query_params.append(('info', _params['info'])) + _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 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': "ProjectReturn", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/projects/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/projects/{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 projects_id_put(self, id : StrictStr, project : Optional[Project] = None, **kwargs) -> ProjectReturn: # 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.projects_id_put(id, project, async_req=True) - >>> result = thread.get() + @validate_call + def projects_id_put( + self, + id: StrictStr, + project: Optional[Project] = 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, + ) -> ProjectReturn: + """ + :param id: (required) :type id: str :param project: :type project: Project - :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_put_with_http_info(id, project, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_put_with_http_info(self, id : StrictStr, project : Optional[Project] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + project=project, + _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': "ProjectReturn", + } + 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 projects_id_put_with_http_info( + self, + id: StrictStr, + project: Optional[Project] = 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[ProjectReturn]: + """ - >>> thread = api.projects_id_put_with_http_info(id, project, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param project: :type project: Project - :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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', - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def projects_id_put_without_preload_content( + self, + id: StrictStr, + project: Optional[Project] = 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 project: + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._projects_id_put_serialize( + id=id, + project=project, + _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 projects_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_id_put_serialize( + self, + id, + project, + _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['project'] is not None: - _body_params = _params['project'] + if project is not None: + _body_params = project + # 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': "ProjectReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/projects/{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 projects_post(self, project : Optional[Project] = None, **kwargs) -> ProjectReturn: # 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 projects_post( + self, + project: Optional[Project] = 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, + ) -> ProjectReturn: + """ - >>> thread = api.projects_post(project, async_req=True) - >>> result = thread.get() :param project: :type project: Project - :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_post_with_http_info(project, **kwargs) # noqa: E501 - - @validate_arguments - def projects_post_with_http_info(self, project : Optional[Project] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _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': "ProjectReturn", + } + 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 projects_post_with_http_info( + self, + project: Optional[Project] = 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[ProjectReturn]: + """ - >>> thread = api.projects_post_with_http_info(project, async_req=True) - >>> result = thread.get() :param project: :type project: Project - :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._projects_post_serialize( + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 = [ - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def projects_post_without_preload_content( + self, + project: Optional[Project] = 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 project: + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._projects_post_serialize( + project=project, + _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 projects_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_post_serialize( + self, + project, + _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['project'] is not None: - _body_params = _params['project'] + if project is not None: + _body_params = project + # 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': "ProjectReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/projects', + 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/neurosynth_compose_sdk/api/put_api.py b/neurosynth_compose_sdk/api/put_api.py index 27135a4..d7b8a79 100644 --- a/neurosynth_compose_sdk/api/put_api.py +++ b/neurosynth_compose_sdk/api/put_api.py @@ -3,33 +3,26 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate from neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn -from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn -from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn from neurosynth_compose_sdk.models.project import Project from neurosynth_compose_sdk.models.project_return import ProjectReturn from neurosynth_compose_sdk.models.result import Result @@ -39,1295 +32,1801 @@ from neurosynth_compose_sdk.models.studyset import Studyset from neurosynth_compose_sdk.models.studyset_return import StudysetReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class PutApi(object): +class PutApi: """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 annotations_id_put(self, id : StrictStr, annotation_update : Optional[AnnotationUpdate] = None, **kwargs) -> AnnotationReturn: # noqa: E501 - """Update an Annotation # noqa: E501 - update 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 + @validate_call + def annotations_id_put( + self, + id: StrictStr, + annotation_update: Optional[AnnotationUpdate] = 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 - >>> thread = api.annotations_id_put(id, annotation_update, async_req=True) - >>> result = thread.get() + update an existing annotation :param id: (required) :type id: str :param annotation_update: :type annotation_update: AnnotationUpdate - :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_update, **kwargs) # noqa: E501 - - @validate_arguments - def annotations_id_put_with_http_info(self, id : StrictStr, annotation_update : Optional[AnnotationUpdate] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an Annotation # noqa: E501 + """ # noqa: E501 + + _param = self._annotations_id_put_serialize( + id=id, + annotation_update=annotation_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update 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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update: Optional[AnnotationUpdate] = 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_update, async_req=True) - >>> result = thread.get() + update an existing annotation :param id: (required) :type id: str :param annotation_update: :type annotation_update: AnnotationUpdate - :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_update=annotation_update, + _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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update' - ] - _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_update: Optional[AnnotationUpdate] = 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 + + update an existing annotation + + :param id: (required) + :type id: str + :param annotation_update: + :type annotation_update: AnnotationUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_update=annotation_update, + _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", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_update, + _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_update'] is not None: - _body_params = _params['annotation_update'] + if annotation_update is not None: + _body_params = annotation_update + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _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 meta_analyses_id_put(self, id : StrictStr, meta_analysis : Optional[MetaAnalysis] = None, **kwargs) -> MetaAnalysisReturn: # noqa: E501 - """Update a meta-analysis # noqa: E501 - update an existing meta-analysis (that has not yet been run) # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.meta_analyses_id_put(id, meta_analysis, async_req=True) - >>> result = thread.get() + + @validate_call + def meta_analyses_id_put( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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, + ) -> MetaAnalysisReturn: + """Update a meta-analysis + + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str :param meta_analysis: :type meta_analysis: MetaAnalysis - :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: MetaAnalysisReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analyses_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analyses_id_put_with_http_info(id, meta_analysis, **kwargs) # noqa: E501 - - @validate_arguments - def meta_analyses_id_put_with_http_info(self, id : StrictStr, meta_analysis : Optional[MetaAnalysis] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a meta-analysis # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing meta-analysis (that has not yet been run) # 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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 meta_analyses_id_put_with_http_info( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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[MetaAnalysisReturn]: + """Update a meta-analysis - >>> thread = api.meta_analyses_id_put_with_http_info(id, meta_analysis, async_req=True) - >>> result = thread.get() + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str :param meta_analysis: :type meta_analysis: MetaAnalysis - :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(MetaAnalysisReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id', - 'meta_analysis' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _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 meta_analyses_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['meta_analysis'] is not None: - _body_params = _params['meta_analysis'] - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+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 = { + _response_types_map: Dict[str, Optional[str]] = { '200': "MetaAnalysisReturn", '400': "MetaAnalysesGet400Response", '401': "MetaAnalysesGet400Response", '404': "MetaAnalysesGet400Response", '422': "MetaAnalysesGet400Response", } - - return self.api_client.call_api( - '/meta-analyses/{id}', 'PUT', - _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 meta_analysis_results_id_put(self, id : StrictStr, result : Optional[Result] = None, **kwargs) -> ResultReturn: # 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.meta_analysis_results_id_put(id, result, async_req=True) - >>> result = thread.get() - - :param id: (required) - :type id: str - :param result: - :type result: Result - :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: ResultReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the meta_analysis_results_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.meta_analysis_results_id_put_with_http_info(id, result, **kwargs) # noqa: E501 + ) - @validate_arguments - def meta_analysis_results_id_put_with_http_info(self, id : StrictStr, result : Optional[Result] = 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 + @validate_call + def meta_analyses_id_put_without_preload_content( + self, + id: StrictStr, + meta_analysis: Optional[MetaAnalysis] = 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 a meta-analysis - >>> thread = api.meta_analysis_results_id_put_with_http_info(id, result, async_req=True) - >>> result = thread.get() + update an existing meta-analysis (that has not yet been run) :param id: (required) :type id: str - :param result: - :type result: Result - :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 meta_analysis: + :type meta_analysis: MetaAnalysis :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(ResultReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() + """ # noqa: E501 + + _param = self._meta_analyses_id_put_serialize( + id=id, + meta_analysis=meta_analysis, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'id', - 'result' - ] - _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': "MetaAnalysisReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 meta_analysis_results_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analyses_id_put_serialize( + self, + id, + meta_analysis, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + 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['result'] is not None: - _body_params = _params['result'] + if meta_analysis is not None: + _body_params = meta_analysis + # 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', + 'application/problem+json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'multipart/form-data'])) - 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', 'upload_key'] # noqa: E501 - - _response_types_map = { - '200': "ResultReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/meta-analysis-results/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/meta-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 neurovault_collections_id_put(self, id : StrictStr, **kwargs) -> NeurovaultCollectionReturn: # 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.neurovault_collections_id_put(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. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: NeurovaultCollectionReturn + @validate_call + def meta_analysis_results_id_put( + self, + id: StrictStr, + result: Optional[Result] = 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, + ) -> ResultReturn: """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_collections_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_collections_id_put_with_http_info(id, **kwargs) # noqa: E501 - @validate_arguments - def neurovault_collections_id_put_with_http_info(self, id : StrictStr, **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.neurovault_collections_id_put_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 result: + :type result: Result :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(NeurovaultCollectionReturn, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _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 neurovault_collections_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 - # 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': "NeurovaultCollectionReturn", + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", } - - return self.api_client.call_api( - '/neurovault-collections/{id}', 'PUT', - _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 neurovault_files_id_put(self, id : StrictStr, collection_id : Optional[StrictStr] = None, exception : Optional[StrictStr] = None, traceback : Optional[StrictStr] = None, status : Optional[StrictStr] = None, image_id : Optional[StrictStr] = None, name : Optional[StrictStr] = None, url : Optional[StrictStr] = None, **kwargs) -> NeurovaultFileReturn: # noqa: E501 - """ # 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 meta_analysis_results_id_put_with_http_info( + self, + id: StrictStr, + result: Optional[Result] = 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[ResultReturn]: + """ - >>> thread = api.neurovault_files_id_put(id, collection_id, exception, traceback, status, image_id, name, url, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param collection_id: - :type collection_id: str - :param exception: - :type exception: str - :param traceback: - :type traceback: str - :param status: - :type status: str - :param image_id: - :type image_id: str - :param name: - :type name: str - :param url: - :type url: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional + :param result: + :type result: Result :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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: NeurovaultFileReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the neurovault_files_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.neurovault_files_id_put_with_http_info(id, collection_id, exception, traceback, status, image_id, name, url, **kwargs) # noqa: E501 + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResultReturn", + } + 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 neurovault_files_id_put_with_http_info(self, id : StrictStr, collection_id : Optional[StrictStr] = None, exception : Optional[StrictStr] = None, traceback : Optional[StrictStr] = None, status : Optional[StrictStr] = None, image_id : Optional[StrictStr] = None, name : Optional[StrictStr] = None, url : Optional[StrictStr] = 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 + @validate_call + def meta_analysis_results_id_put_without_preload_content( + self, + id: StrictStr, + result: Optional[Result] = 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: + """ - >>> thread = api.neurovault_files_id_put_with_http_info(id, collection_id, exception, traceback, status, image_id, name, url, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str - :param collection_id: - :type collection_id: str - :param exception: - :type exception: str - :param traceback: - :type traceback: str - :param status: - :type status: str - :param image_id: - :type image_id: str - :param name: - :type name: str - :param url: - :type url: 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 result: + :type result: Result :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(NeurovaultFileReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._meta_analysis_results_id_put_serialize( + id=id, + result=result, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() - - _all_params = [ - 'id', - 'collection_id', - 'exception', - 'traceback', - 'status', - 'image_id', - 'name', - 'url' - ] - _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': "ResultReturn", + } + 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 neurovault_files_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _meta_analysis_results_id_put_serialize( + self, + id, + result, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['id']: - _path_params['id'] = _params['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 + 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 = {} - if _params['collection_id']: - _form_params.append(('collection_id', _params['collection_id'])) - - if _params['exception']: - _form_params.append(('exception', _params['exception'])) - - if _params['traceback']: - _form_params.append(('traceback', _params['traceback'])) - - if _params['status']: - _form_params.append(('status', _params['status'])) - - if _params['image_id']: - _form_params.append(('image_id', _params['image_id'])) - - if _params['name']: - _form_params.append(('name', _params['name'])) + # process the body parameter + if result is not None: + _body_params = result - if _params['url']: - _form_params.append(('url', _params['url'])) - # 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' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['multipart/form-data'])) - 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', + 'multipart/form-data' + ] + ) + ) + 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': "NeurovaultFileReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token', + 'upload_key' + ] - return self.api_client.call_api( - '/neurovault-files/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/meta-analysis-results/{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 projects_id_put(self, id : StrictStr, project : Optional[Project] = None, **kwargs) -> ProjectReturn: # 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.projects_id_put(id, project, async_req=True) - >>> result = thread.get() + + @validate_call + def projects_id_put( + self, + id: StrictStr, + project: Optional[Project] = 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, + ) -> ProjectReturn: + """ + :param id: (required) :type id: str :param project: :type project: Project - :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: ProjectReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the projects_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.projects_id_put_with_http_info(id, project, **kwargs) # noqa: E501 - - @validate_arguments - def projects_id_put_with_http_info(self, id : StrictStr, project : Optional[Project] = None, **kwargs) -> ApiResponse: # noqa: E501 - """ # noqa: E501 + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + project=project, + _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': "ProjectReturn", + } + 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 projects_id_put_with_http_info( + self, + id: StrictStr, + project: Optional[Project] = 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[ProjectReturn]: + """ - >>> thread = api.projects_id_put_with_http_info(id, project, async_req=True) - >>> result = thread.get() :param id: (required) :type id: str :param project: :type project: Project - :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(ProjectReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._projects_id_put_serialize( + id=id, + project=project, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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', - 'project' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def projects_id_put_without_preload_content( + self, + id: StrictStr, + project: Optional[Project] = 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 project: + :type project: Project + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._projects_id_put_serialize( + id=id, + project=project, + _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 projects_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "ProjectReturn", + } + 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 _projects_id_put_serialize( + self, + id, + project, + _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['project'] is not None: - _body_params = _params['project'] + if project is not None: + _body_params = project + # 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': "ProjectReturn", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/projects/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/projects/{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 specifications_id_put(self, id : StrictStr, specification : Optional[Specification] = None, **kwargs) -> SpecificationReturn: # noqa: E501 - """Update Meta-Analysis specification # noqa: E501 - update an existing meta analysis specification # 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 specifications_id_put( + self, + id: StrictStr, + specification: Optional[Specification] = 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, + ) -> SpecificationReturn: + """Update Meta-Analysis specification - >>> thread = api.specifications_id_put(id, specification, async_req=True) - >>> result = thread.get() + update an existing meta analysis specification :param id: (required) :type id: str :param specification: :type specification: Specification - :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_id_put_with_http_info(id, specification, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_id_put_with_http_info(self, id : StrictStr, specification : Optional[Specification] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update Meta-Analysis specification # noqa: E501 + """ # noqa: E501 + + _param = self._specifications_id_put_serialize( + id=id, + specification=specification, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing meta analysis specification # 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': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 specifications_id_put_with_http_info( + self, + id: StrictStr, + specification: Optional[Specification] = 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[SpecificationReturn]: + """Update Meta-Analysis specification - >>> thread = api.specifications_id_put_with_http_info(id, specification, async_req=True) - >>> result = thread.get() + update an existing meta analysis specification :param id: (required) :type id: str :param specification: :type specification: Specification - :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_id_put_serialize( + id=id, + specification=specification, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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', - 'specification' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def specifications_id_put_without_preload_content( + self, + id: StrictStr, + specification: Optional[Specification] = 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 Meta-Analysis specification + + update an existing meta analysis specification + + :param id: (required) + :type id: str + :param specification: + :type specification: Specification + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_id_put_serialize( + id=id, + specification=specification, + _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 specifications_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 _specifications_id_put_serialize( + self, + id, + specification, + _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['specification'] is not None: - _body_params = _params['specification'] + if specification is not None: + _body_params = specification + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "SpecificationReturn", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/specifications/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/specifications/{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 : Optional[Studyset] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """Update a Studyset # noqa: E501 - update an existing serialized/referenced 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, async_req=True) - >>> result = thread.get() + + @validate_call + def studysets_id_put( + self, + id: StrictStr, + studyset: Optional[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, + ) -> StudysetReturn: + """Update a Studyset + + update an existing serialized/referenced studyset :param id: (required) :type id: str :param studyset: :type studyset: Studyset - :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, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_put_with_http_info(self, id : StrictStr, studyset : Optional[Studyset] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a Studyset # noqa: E501 + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset=studyset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - update an existing serialized/referenced 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", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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: Optional[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[StudysetReturn]: + """Update a Studyset - >>> thread = api.studysets_id_put_with_http_info(id, studyset, async_req=True) - >>> result = thread.get() + update an existing serialized/referenced studyset :param id: (required) :type id: str :param studyset: :type studyset: Studyset - :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=studyset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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' - ] - _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: Optional[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: + """Update a Studyset + + update an existing serialized/referenced studyset + + :param id: (required) + :type id: str + :param studyset: + :type studyset: Studyset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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=studyset, + _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", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_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'] is not None: - _body_params = _params['studyset'] + if studyset is not None: + _body_params = studyset + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': None, - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _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 + ) + + diff --git a/neurosynth_compose_sdk/api/specifications_api.py b/neurosynth_compose_sdk/api/specifications_api.py index 458b6b4..4d63bac 100644 --- a/neurosynth_compose_sdk/api/specifications_api.py +++ b/neurosynth_compose_sdk/api/specifications_api.py @@ -3,628 +3,1142 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.specification import Specification from neurosynth_compose_sdk.models.specification_list import SpecificationList from neurosynth_compose_sdk.models.specification_post_body import SpecificationPostBody from neurosynth_compose_sdk.models.specification_return import SpecificationReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class SpecificationsApi(object): +class SpecificationsApi: """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 specifications_get(self, **kwargs) -> SpecificationList: # noqa: E501 - """Get a list of Specifications # noqa: E501 - list of meta-analysis specifications # 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 specifications_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, + ) -> SpecificationList: + """Get a list of Specifications - >>> thread = api.specifications_get(async_req=True) - >>> result = thread.get() + list of meta-analysis specifications - :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: SpecificationList - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_get_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def specifications_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get a list of Specifications # noqa: E501 - - list of meta-analysis specifications # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_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._specifications_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_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[SpecificationList]: + """Get a list of Specifications + + list of meta-analysis specifications + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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(SpecificationList, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._specifications_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': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 specifications_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 Specifications + + list of meta-analysis specifications + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_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 specifications_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationList", + '400': "MetaAnalysesGet400Response", + } + 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 _specifications_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "SpecificationList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/specifications', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/specifications', + 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 specifications_id_get(self, id : StrictStr, **kwargs) -> SpecificationReturn: # noqa: E501 - """Get information about a Specification # noqa: E501 - get a meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_id_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def specifications_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, + ) -> SpecificationReturn: + """Get information about a Specification + + get a meta-analysis specification :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_id_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_id_get_with_http_info(id, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get information about a Specification # noqa: E501 - - get a meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._specifications_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': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 specifications_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[SpecificationReturn]: + """Get information about a Specification + + get a meta-analysis specification :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_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': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 specifications_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 information about a Specification + + get a meta-analysis specification + + :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._specifications_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 specifications_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 _specifications_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "SpecificationReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - return self.api_client.call_api( - '/specifications/{id}', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/specifications/{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 specifications_id_put(self, id : StrictStr, specification : Optional[Specification] = None, **kwargs) -> SpecificationReturn: # noqa: E501 - """Update Meta-Analysis specification # noqa: E501 - update an existing meta analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.specifications_id_put(id, specification, async_req=True) - >>> result = thread.get() + + @validate_call + def specifications_id_put( + self, + id: StrictStr, + specification: Optional[Specification] = 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, + ) -> SpecificationReturn: + """Update Meta-Analysis specification + + update an existing meta analysis specification :param id: (required) :type id: str :param specification: :type specification: Specification - :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_id_put_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_id_put_with_http_info(id, specification, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_id_put_with_http_info(self, id : StrictStr, specification : Optional[Specification] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update Meta-Analysis specification # noqa: E501 - - update an existing meta analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_id_put_with_http_info(id, specification, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._specifications_id_put_serialize( + id=id, + specification=specification, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 specifications_id_put_with_http_info( + self, + id: StrictStr, + specification: Optional[Specification] = 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[SpecificationReturn]: + """Update Meta-Analysis specification + + update an existing meta analysis specification :param id: (required) :type id: str :param specification: :type specification: Specification - :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_id_put_serialize( + id=id, + specification=specification, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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', - 'specification' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def specifications_id_put_without_preload_content( + self, + id: StrictStr, + specification: Optional[Specification] = 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 Meta-Analysis specification + + update an existing meta analysis specification + + :param id: (required) + :type id: str + :param specification: + :type specification: Specification + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_id_put_serialize( + id=id, + specification=specification, + _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 specifications_id_put" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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 _specifications_id_put_serialize( + self, + id, + specification, + _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['specification'] is not None: - _body_params = _params['specification'] + if specification is not None: + _body_params = specification + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "SpecificationReturn", - '400': "MetaAnalysesGet400Response", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/specifications/{id}', 'PUT', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PUT', + resource_path='/specifications/{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 specifications_post(self, specification_post_body : Optional[SpecificationPostBody] = None, **kwargs) -> SpecificationReturn: # noqa: E501 - """Create a Specification # noqa: E501 - create a new meta-analysis specification # 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 specifications_post( + self, + specification_post_body: Optional[SpecificationPostBody] = 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, + ) -> SpecificationReturn: + """Create a Specification - >>> thread = api.specifications_post(specification_post_body, async_req=True) - >>> result = thread.get() + create a new meta-analysis specification :param specification_post_body: :type specification_post_body: SpecificationPostBody - :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: SpecificationReturn - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - raise ValueError("Error! Please call the specifications_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") - return self.specifications_post_with_http_info(specification_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def specifications_post_with_http_info(self, specification_post_body : Optional[SpecificationPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a Specification # noqa: E501 - - create a new meta-analysis specification # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.specifications_post_with_http_info(specification_post_body, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._specifications_post_serialize( + specification_post_body=specification_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 specifications_post_with_http_info( + self, + specification_post_body: Optional[SpecificationPostBody] = 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[SpecificationReturn]: + """Create a Specification + + create a new meta-analysis specification :param specification_post_body: :type specification_post_body: SpecificationPostBody - :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(SpecificationReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._specifications_post_serialize( + specification_post_body=specification_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 = [ - 'specification_post_body' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def specifications_post_without_preload_content( + self, + specification_post_body: Optional[SpecificationPostBody] = 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 Specification + + create a new meta-analysis specification + + :param specification_post_body: + :type specification_post_body: SpecificationPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._specifications_post_serialize( + specification_post_body=specification_post_body, + _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 specifications_post" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpecificationReturn", + '400': "MetaAnalysesGet400Response", + '422': None, + '500': "MetaAnalysesGet400Response", + } + 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 _specifications_post_serialize( + self, + specification_post_body, + _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['specification_post_body'] is not None: - _body_params = _params['specification_post_body'] + if specification_post_body is not None: + _body_params = specification_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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': "SpecificationReturn", - '400': "MetaAnalysesGet400Response", - '422': None, - '500': "MetaAnalysesGet400Response", - } + _auth_settings: List[str] = [ + 'JSON-Web-Token' + ] - return self.api_client.call_api( - '/specifications', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/specifications', + 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/neurosynth_compose_sdk/api/studysets_api.py b/neurosynth_compose_sdk/api/studysets_api.py index c7693ff..ac08db1 100644 --- a/neurosynth_compose_sdk/api/studysets_api.py +++ b/neurosynth_compose_sdk/api/studysets_api.py @@ -3,628 +3,1142 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.studyset import Studyset from neurosynth_compose_sdk.models.studyset_list import StudysetList from neurosynth_compose_sdk.models.studyset_post_body import StudysetPostBody from neurosynth_compose_sdk.models.studyset_return import StudysetReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_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, **kwargs) -> StudysetList: # noqa: E501 - """Get a list of Studysets # noqa: E501 - get a list of serialized/referenced 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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(async_req=True) - >>> result = thread.get() + get a list of serialized/referenced studysets - :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(**kwargs) # noqa: E501 - - @validate_arguments - def studysets_get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get a list of Studysets # noqa: E501 - - get a list of serialized/referenced 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(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._studysets_get_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 serialized/referenced studysets + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_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)) - """ + """ # noqa: E501 - _params = locals() + _param = self._studysets_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': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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 studysets_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 Studysets + + get a list of serialized/referenced studysets + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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( + _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'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetList", + '400': "MetaAnalysesGet400Response", + } + 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_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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetList", - '400': "MetaAnalysesGet400Response", - } + # authentication setting + _auth_settings: List[str] = [ + ] - 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_get(self, id : StrictStr, **kwargs) -> StudysetReturn: # noqa: E501 - """Get information about a Studyset # noqa: E501 - get a single serialized/referenced 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_get(id, async_req=True) - >>> result = thread.get() + + @validate_call + def studysets_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, + ) -> StudysetReturn: + """Get information about a Studyset + + get a single serialized/referenced 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: 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, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_get_with_http_info(self, id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Get information about a Studyset # noqa: E501 - - get a single serialized/referenced 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_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 information about a Studyset + + get a single serialized/referenced 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: tuple(StudysetReturn, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._studysets_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': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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 studysets_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 information about a Studyset + + get a single serialized/referenced 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_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 studysets_id_get" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + } + 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, + _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', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+json' + ] + ) - # authentication setting - _auth_settings = [] # noqa: E501 - _response_types_map = { - '200': "StudysetReturn", - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - } + # 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 : Optional[Studyset] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """Update a Studyset # noqa: E501 - update an existing serialized/referenced 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, async_req=True) - >>> result = thread.get() + + @validate_call + def studysets_id_put( + self, + id: StrictStr, + studyset: Optional[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, + ) -> StudysetReturn: + """Update a Studyset + + update an existing serialized/referenced studyset :param id: (required) :type id: str :param studyset: :type studyset: Studyset - :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, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_id_put_with_http_info(self, id : StrictStr, studyset : Optional[Studyset] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a Studyset # noqa: E501 - - update an existing serialized/referenced 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, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_id_put_serialize( + id=id, + studyset=studyset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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: Optional[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[StudysetReturn]: + """Update a Studyset + + update an existing serialized/referenced studyset :param id: (required) :type id: str :param studyset: :type studyset: Studyset - :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=studyset, + _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", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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' - ] - _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: Optional[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: + """Update a Studyset + + update an existing serialized/referenced studyset + + :param id: (required) + :type id: str + :param studyset: + :type studyset: Studyset + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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=studyset, + _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", + '400': None, + '401': "MetaAnalysesGet400Response", + '404': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + } + 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_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'] is not None: - _body_params = _params['studyset'] + if studyset is not None: + _body_params = studyset + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': None, - '401': "MetaAnalysesGet400Response", - '404': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - } + _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_post_body : Optional[StudysetPostBody] = None, **kwargs) -> StudysetReturn: # noqa: E501 - """Create a new Studyset # noqa: E501 - create a new serialized/referenced 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 studysets_post( + self, + studyset_post_body: Optional[StudysetPostBody] = 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: + """Create a new Studyset - >>> thread = api.studysets_post(studyset_post_body, async_req=True) - >>> result = thread.get() + create a new serialized/referenced studyset :param studyset_post_body: :type studyset_post_body: StudysetPostBody - :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_post_body, **kwargs) # noqa: E501 - - @validate_arguments - def studysets_post_with_http_info(self, studyset_post_body : Optional[StudysetPostBody] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new Studyset # noqa: E501 - - create a new serialized/referenced 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_post_body, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._studysets_post_serialize( + studyset_post_body=studyset_post_body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "StudysetReturn", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body: Optional[StudysetPostBody] = 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]: + """Create a new Studyset + + create a new serialized/referenced studyset :param studyset_post_body: :type studyset_post_body: StudysetPostBody - :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_post_body=studyset_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body' - ] - _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_post_body: Optional[StudysetPostBody] = 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 new Studyset + + create a new serialized/referenced studyset + + :param studyset_post_body: + :type studyset_post_body: StudysetPostBody + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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_post_body=studyset_post_body, + _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", + '400': "MetaAnalysesGet400Response", + '422': "MetaAnalysesGet400Response", + '500': "MetaAnalysesGet400Response", + } + 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_post_body, + _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_post_body'] is not None: - _body_params = _params['studyset_post_body'] + if studyset_post_body is not None: + _body_params = studyset_post_body + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'application/problem+json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/problem+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", - '400': "MetaAnalysesGet400Response", - '422': "MetaAnalysesGet400Response", - '500': "MetaAnalysesGet400Response", - } + _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/neurosynth_compose_sdk/api/users_api.py b/neurosynth_compose_sdk/api/users_api.py index 5a5b12a..59d3ee6 100644 --- a/neurosynth_compose_sdk/api/users_api.py +++ b/neurosynth_compose_sdk/api/users_api.py @@ -3,617 +3,1107 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.user import User from neurosynth_compose_sdk.models.user_list import UserList from neurosynth_compose_sdk.models.user_return import UserReturn -from neurosynth_compose_sdk.api_client import ApiClient +from neurosynth_compose_sdk.api_client import ApiClient, RequestSerialized from neurosynth_compose_sdk.api_response import ApiResponse -from neurosynth_compose_sdk.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from neurosynth_compose_sdk.rest import RESTResponseType -class UsersApi(object): +class UsersApi: """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 - """GET list of Users # noqa: E501 - List all 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: + """GET list of Users - >>> thread = api.users_get(async_req=True) - >>> result = thread.get() + List all 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 - """GET list of Users # noqa: E501 - - List all 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]: + """GET list of Users + + List all 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 - _params = locals() + _param = self._users_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': "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, + ) + + + @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: + """GET list of Users + + List all 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 = [] # noqa: E501 - _response_types_map = { - '200': "UserList", - } + # authentication setting + _auth_settings: List[str] = [ + ] - 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) -> UserReturn: # noqa: E501 - """Get User Info by User ID # noqa: E501 - Retrieve the information of the user with the matching user 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.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, + ) -> UserReturn: + """Get User Info by User ID + + Retrieve the information of the user with the matching user ID. :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: UserReturn - """ - 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 - """Get User Info by User ID # noqa: E501 - - Retrieve the information of the user with the matching user 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.users_id_get_with_http_info(id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_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': "UserReturn", + } + 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[UserReturn]: + """Get User Info by User ID + + Retrieve the information of the user with the matching user ID. :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(UserReturn, 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': "UserReturn", + } + 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: + """Get User Info by User ID + + Retrieve the information of the user with the matching user 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._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': "UserReturn", + } + 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': "UserReturn", - } + # 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) -> UserReturn: # noqa: E501 - """Update User Information # noqa: E501 - update information about a 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, + ) -> UserReturn: + """Update User Information + + update information about a 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: UserReturn - """ - 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 User Information # noqa: E501 - - update information about a 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_with_http_info(id, user, async_req=True) - >>> result = thread.get() + """ # 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 + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserReturn", + } + 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[UserReturn]: + """Update User Information + + update information about a 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(UserReturn, 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': "UserReturn", + } + 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 User Information + + update information about a 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': "UserReturn", + } + 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': "UserReturn", - } + _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) -> UserReturn: # noqa: E501 - """Create A New User # noqa: E501 - create a single 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_post(user, async_req=True) - >>> result = thread.get() + + @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, + ) -> UserReturn: + """Create A New User + + create a single 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: UserReturn - """ - 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 - """Create A New User # noqa: E501 - - create a single 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_post_with_http_info(user, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._users_post_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserReturn", + } + 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[UserReturn]: + """Create A New User + + create a single 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(UserReturn, 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': "UserReturn", + } + 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 New User + + create a single 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': "UserReturn", + } + 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': "UserReturn", - } + _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/neurosynth_compose_sdk/api_client.py b/neurosynth_compose_sdk/api_client.py index 406306f..60e332f 100644 --- a/neurosynth_compose_sdk/api_client.py +++ b/neurosynth_compose_sdk/api_client.py @@ -3,36 +3,47 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.configuration import Configuration -from neurosynth_compose_sdk.api_response import ApiResponse +from neurosynth_compose_sdk.api_response import ApiResponse, T as ApiResponseT import neurosynth_compose_sdk.models from neurosynth_compose_sdk import rest -from neurosynth_compose_sdk.exceptions import ApiValueError, ApiException - - -class ApiClient(object): +from neurosynth_compose_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/neurosynth_compose_sdk/api_response.py b/neurosynth_compose_sdk/api_response.py index d81c2ff..9bc7c11 100644 --- a/neurosynth_compose_sdk/api_response.py +++ b/neurosynth_compose_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/neurosynth_compose_sdk/configuration.py b/neurosynth_compose_sdk/configuration.py index 48c4000..971d06b 100644 --- a/neurosynth_compose_sdk/configuration.py +++ b/neurosynth_compose_sdk/configuration.py @@ -3,24 +3,27 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -28,10 +31,115 @@ '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, + "upload_key": APIKeyAuthSetting, + }, + 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,9 +158,11 @@ 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: @@ -76,16 +186,26 @@ class Configuration(object): Cookie: JSESSIONID abc123 """ - _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://compose.neurosynth.org/api" if host is None else host @@ -99,6 +219,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 """ @@ -125,9 +248,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 """ @@ -139,13 +259,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 """ @@ -179,7 +302,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 @@ -188,7 +311,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 @@ -206,7 +329,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 @@ -220,11 +343,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 @@ -235,7 +358,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. @@ -245,7 +368,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, @@ -255,11 +378,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 @@ -271,7 +394,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 @@ -290,7 +413,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. @@ -299,7 +422,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. @@ -321,7 +444,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. @@ -332,7 +455,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. @@ -343,7 +466,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. @@ -360,7 +483,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. @@ -375,12 +500,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', @@ -399,7 +524,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. @@ -411,7 +536,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 @@ -431,7 +556,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 @@ -471,12 +601,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/neurosynth_compose_sdk/exceptions.py b/neurosynth_compose_sdk/exceptions.py index ff855da..e9a8d2b 100644 --- a/neurosynth_compose_sdk/exceptions.py +++ b/neurosynth_compose_sdk/exceptions.py @@ -3,15 +3,17 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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/neurosynth_compose_sdk/models/__init__.py b/neurosynth_compose_sdk/models/__init__.py index b43171f..7e43ec5 100644 --- a/neurosynth_compose_sdk/models/__init__.py +++ b/neurosynth_compose_sdk/models/__init__.py @@ -4,14 +4,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 @@ -20,7 +20,6 @@ from neurosynth_compose_sdk.models.annotation_post_body import AnnotationPostBody from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn from neurosynth_compose_sdk.models.annotation_update import AnnotationUpdate -from neurosynth_compose_sdk.models.annotation_update_all_of import AnnotationUpdateAllOf from neurosynth_compose_sdk.models.corrector import Corrector from neurosynth_compose_sdk.models.estimator import Estimator from neurosynth_compose_sdk.models.meta_analyses_get400_response import MetaAnalysesGet400Response diff --git a/neurosynth_compose_sdk/models/annotation.py b/neurosynth_compose_sdk/models/annotation.py index 2c4b014..75efba0 100644 --- a/neurosynth_compose_sdk/models/annotation.py +++ b/neurosynth_compose_sdk/models/annotation.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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, 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 Annotation(BaseModel): """ a holder/reference to the annotation on neurostore - """ - neurostore_id: Optional[StrictStr] = Field(None, description="the id of the annotation on neurostore") - snapshot: Optional[Dict[str, Any]] = Field(None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") - studyset: Optional[StrictStr] = Field(None, description="The related cached studyset to this annotation.") + """ # noqa: E501 + neurostore_id: Optional[StrictStr] = Field(default=None, description="the id of the annotation on neurostore") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") + studyset: Optional[StrictStr] = Field(default=None, description="The related cached studyset to this annotation.") neurostore_url: Optional[StrictStr] = None - __properties = ["neurostore_id", "snapshot", "studyset", "neurostore_url"] + __properties: ClassVar[List[str]] = ["neurostore_id", "snapshot", "studyset", "neurostore_url"] + + 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) -> Annotation: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Annotation 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={ - "studyset", - "neurostore_url", - }, - 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([ + "studyset", + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Annotation: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Annotation from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Annotation.parse_obj(obj) + return cls.model_validate(obj) - _obj = Annotation.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), "studyset": obj.get("studyset"), @@ -82,3 +100,4 @@ def from_dict(cls, obj: dict) -> Annotation: }) return _obj + diff --git a/neurosynth_compose_sdk/models/annotation_list.py b/neurosynth_compose_sdk/models/annotation_list.py index a1179e0..5231fc1 100644 --- a/neurosynth_compose_sdk/models/annotation_list.py +++ b/neurosynth_compose_sdk/models/annotation_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.annotation_return import AnnotationReturn +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[Dict[str, Any]] = 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 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, + _obj = cls.model_validate({ + "results": [AnnotationReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/annotation_post_body.py b/neurosynth_compose_sdk/models/annotation_post_body.py index a620fe7..de72e0a 100644 --- a/neurosynth_compose_sdk/models/annotation_post_body.py +++ b/neurosynth_compose_sdk/models/annotation_post_body.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,82 @@ 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 AnnotationPostBody(BaseModel): """ AnnotationPostBody - """ - cached_studyset_id: StrictStr = Field(...) - neurostore_id: Optional[StrictStr] = Field(None, description="the id of the annotation on neurostore") - snapshot: Optional[Dict[str, Any]] = Field(None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") - studyset: Optional[StrictStr] = Field(None, description="The related cached studyset to this annotation.") + """ # noqa: E501 + cached_studyset_id: StrictStr + neurostore_id: Optional[StrictStr] = Field(default=None, description="the id of the annotation on neurostore") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") + studyset: Optional[StrictStr] = Field(default=None, description="The related cached studyset to this annotation.") neurostore_url: Optional[StrictStr] = None - __properties = ["cached_studyset_id", "neurostore_id", "snapshot", "studyset", "neurostore_url"] + __properties: ClassVar[List[str]] = ["cached_studyset_id", "neurostore_id", "snapshot", "studyset", "neurostore_url"] + + 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) -> AnnotationPostBody: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationPostBody 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={ - "studyset", - "neurostore_url", - }, - 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([ + "studyset", + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationPostBody: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationPostBody from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationPostBody.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationPostBody.parse_obj({ + _obj = cls.model_validate({ "cached_studyset_id": obj.get("cached_studyset_id"), "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), @@ -84,3 +102,4 @@ def from_dict(cls, obj: dict) -> AnnotationPostBody: }) return _obj + diff --git a/neurosynth_compose_sdk/models/annotation_return.py b/neurosynth_compose_sdk/models/annotation_return.py index 090be59..f60d4c2 100644 --- a/neurosynth_compose_sdk/models/annotation_return.py +++ b/neurosynth_compose_sdk/models/annotation_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,85 +19,107 @@ 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 AnnotationReturn(BaseModel): """ AnnotationReturn - """ - neurostore_id: Optional[StrictStr] = Field(None, description="the id of the annotation on neurostore") - snapshot: Optional[Dict[str, Any]] = Field(None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") - studyset: Optional[StrictStr] = Field(None, description="The related cached studyset to this annotation.") + """ # noqa: E501 + neurostore_id: Optional[StrictStr] = Field(default=None, description="the id of the annotation on neurostore") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") + studyset: Optional[StrictStr] = Field(default=None, description="The related cached studyset to this annotation.") neurostore_url: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["neurostore_id", "snapshot", "studyset", "neurostore_url", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["neurostore_id", "snapshot", "studyset", "neurostore_url", "id", "updated_at", "created_at", "user", "username"] + + 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) -> AnnotationReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationReturn 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={ - "studyset", - "neurostore_url", - "updated_at", - "created_at", - "username", - }, - 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. + """ + excluded_fields: Set[str] = set([ + "studyset", + "neurostore_url", + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = 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) -> AnnotationReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationReturn.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), "studyset": obj.get("studyset"), @@ -110,3 +132,4 @@ def from_dict(cls, obj: dict) -> AnnotationReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/annotation_update.py b/neurosynth_compose_sdk/models/annotation_update.py index adbda82..32920d6 100644 --- a/neurosynth_compose_sdk/models/annotation_update.py +++ b/neurosynth_compose_sdk/models/annotation_update.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,69 +18,88 @@ 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 AnnotationUpdate(BaseModel): """ AnnotationUpdate - """ - cached_studyset_id: Optional[StrictStr] = None - neurostore_id: Optional[StrictStr] = Field(None, description="the id of the annotation on neurostore") - snapshot: Optional[Dict[str, Any]] = Field(None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") - studyset: Optional[StrictStr] = Field(None, description="The related cached studyset to this annotation.") + """ # noqa: E501 + neurostore_id: Optional[StrictStr] = Field(default=None, description="the id of the annotation on neurostore") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="the snapshot taken of the annotation pending a successful run of the meta-analytic algorithm") + studyset: Optional[StrictStr] = Field(default=None, description="The related cached studyset to this annotation.") neurostore_url: Optional[StrictStr] = None - __properties = ["cached_studyset_id", "neurostore_id", "snapshot", "studyset", "neurostore_url"] + cached_studyset_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["neurostore_id", "snapshot", "studyset", "neurostore_url", "cached_studyset_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) -> AnnotationUpdate: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AnnotationUpdate 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={ - "studyset", - "neurostore_url", - }, - 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([ + "studyset", + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AnnotationUpdate: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AnnotationUpdate from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AnnotationUpdate.parse_obj(obj) + return cls.model_validate(obj) - _obj = AnnotationUpdate.parse_obj({ - "cached_studyset_id": obj.get("cached_studyset_id"), + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), "studyset": obj.get("studyset"), - "neurostore_url": obj.get("neurostore_url") + "neurostore_url": obj.get("neurostore_url"), + "cached_studyset_id": obj.get("cached_studyset_id") }) return _obj + diff --git a/neurosynth_compose_sdk/models/corrector.py b/neurosynth_compose_sdk/models/corrector.py index 5d56f96..c9c6416 100644 --- a/neurosynth_compose_sdk/models/corrector.py +++ b/neurosynth_compose_sdk/models/corrector.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,74 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Corrector(BaseModel): """ The function/class applying statistical adjustments to the output of the meta-analysis (optional). - """ - type: Optional[constr(strict=True, min_length=1)] = Field(None, description="the name of the function/class performing the correction. For example FWECorrector from NiMARE would be valid.") - args: Optional[Dict[str, Any]] = Field(None, description="key word arguments passed to the corrector to modidy default functionality, such as number of iterations, or the particular method of correction being applied.") - __properties = ["type", "args"] + """ # noqa: E501 + type: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="the name of the function/class performing the correction. For example FWECorrector from NiMARE would be valid.") + args: Optional[Dict[str, Any]] = Field(default=None, description="key word arguments passed to the corrector to modidy default functionality, such as number of iterations, or the particular method of correction being applied.") + __properties: ClassVar[List[str]] = ["type", "args"] + + 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) -> Corrector: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Corrector 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) -> Corrector: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Corrector from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Corrector.parse_obj(obj) + return cls.model_validate(obj) - _obj = Corrector.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), "args": obj.get("args") }) return _obj + diff --git a/neurosynth_compose_sdk/models/estimator.py b/neurosynth_compose_sdk/models/estimator.py index aa56fd6..a77ee6a 100644 --- a/neurosynth_compose_sdk/models/estimator.py +++ b/neurosynth_compose_sdk/models/estimator.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,74 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Estimator(BaseModel): """ the specification for the function/class running the meta-analysis - """ - type: Optional[constr(strict=True, min_length=1)] = Field(None, description="the meta-analytic algorithm applied to the data. Currently this should be directly tied to the function/class running the meta-analysis. For example, ALE, or MKDADensity are valid NiMARE classes to put here.") - args: Optional[Dict[str, Any]] = Field(None, description="arbitrary keyword arguments to be passed into the function/class to modify default functionality, this could modify the kernel, resampling methods, or any other behavior defined in the function/class (like MKDADensity).") - __properties = ["type", "args"] + """ # noqa: E501 + type: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="the meta-analytic algorithm applied to the data. Currently this should be directly tied to the function/class running the meta-analysis. For example, ALE, or MKDADensity are valid NiMARE classes to put here.") + args: Optional[Dict[str, Any]] = Field(default=None, description="arbitrary keyword arguments to be passed into the function/class to modify default functionality, this could modify the kernel, resampling methods, or any other behavior defined in the function/class (like MKDADensity).") + __properties: ClassVar[List[str]] = ["type", "args"] + + 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) -> Estimator: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Estimator 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) -> Estimator: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Estimator from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Estimator.parse_obj(obj) + return cls.model_validate(obj) - _obj = Estimator.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), "args": obj.get("args") }) return _obj + diff --git a/neurosynth_compose_sdk/models/meta_analyses_get400_response.py b/neurosynth_compose_sdk/models/meta_analyses_get400_response.py index f8adf76..8713411 100644 --- a/neurosynth_compose_sdk/models/meta_analyses_get400_response.py +++ b/neurosynth_compose_sdk/models/meta_analyses_get400_response.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 MetaAnalysesGet400Response(BaseModel): """ MetaAnalysesGet400Response - """ + """ # 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) -> MetaAnalysesGet400Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaAnalysesGet400Response 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) -> MetaAnalysesGet400Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaAnalysesGet400Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaAnalysesGet400Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaAnalysesGet400Response.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) -> MetaAnalysesGet400Response: }) return _obj + diff --git a/neurosynth_compose_sdk/models/meta_analysis.py b/neurosynth_compose_sdk/models/meta_analysis.py index 98a4162..f3c7341 100644 --- a/neurosynth_compose_sdk/models/meta_analysis.py +++ b/neurosynth_compose_sdk/models/meta_analysis.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,30 +18,31 @@ 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 neurosynth_compose_sdk.models.meta_analysis_annotation import MetaAnalysisAnnotation from neurosynth_compose_sdk.models.meta_analysis_results import MetaAnalysisResults from neurosynth_compose_sdk.models.meta_analysis_specification import MetaAnalysisSpecification from neurosynth_compose_sdk.models.meta_analysis_studyset import MetaAnalysisStudyset from neurosynth_compose_sdk.models.neurostore_analysis import NeurostoreAnalysis +from typing import Optional, Set +from typing_extensions import Self class MetaAnalysis(BaseModel): """ The combination of the specification determining what meta-analysis to run (required), the studyset to act as input to the meta-analytic algorithm (required), and the annotation to provide human readable annotations as well as acts as an optional filter on which analyses to select within the studyset (optional, but suggested). - """ + """ # noqa: E501 specification: Optional[MetaAnalysisSpecification] = None studyset: Optional[MetaAnalysisStudyset] = None annotation: Optional[MetaAnalysisAnnotation] = None - name: Optional[StrictStr] = Field(None, description="Human-readable name of the meta-analysis.") - description: Optional[StrictStr] = Field(None, description="Long form description of the meta-analysis.") - cached_studyset_id: Optional[StrictStr] = Field(None, description="The id of the studyset on neurosynth-compose (as opposed to the id of the studyset on neurostore). Multiple snapshots of the studyset can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") - cached_annotation_id: Optional[StrictStr] = Field(None, description="The id of the annotation on neurosynth-compose (as opposed to the id of the annotation on neurostore). Multiple snapshots of the annotation can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") + name: Optional[StrictStr] = Field(default=None, description="Human-readable name of the meta-analysis.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the meta-analysis.") + cached_studyset_id: Optional[StrictStr] = Field(default=None, description="The id of the studyset on neurosynth-compose (as opposed to the id of the studyset on neurostore). Multiple snapshots of the studyset can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") + cached_annotation_id: Optional[StrictStr] = Field(default=None, description="The id of the annotation on neurosynth-compose (as opposed to the id of the annotation on neurostore). Multiple snapshots of the annotation can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") results: Optional[MetaAnalysisResults] = None provenance: Optional[Dict[str, Any]] = None project: Optional[StrictStr] = None - run_key: Optional[StrictStr] = Field(None, description="a special key used to upload the results of this meta analysis. Can be used as an alternative to using your auth token from login. ") + run_key: Optional[StrictStr] = Field(default=None, description="a special key used to upload the results of this meta analysis. Can be used as an alternative to using your auth token from login. ") neurostore_analysis: Optional[NeurostoreAnalysis] = None cognitive_contrast_cogatlas: Optional[StrictStr] = None cognitive_contrast_cogatlas_id: Optional[StrictStr] = None @@ -50,36 +51,55 @@ class MetaAnalysis(BaseModel): cached_studyset: Optional[StrictStr] = None cached_annotation: Optional[StrictStr] = None neurostore_url: Optional[StrictStr] = None - __properties = ["specification", "studyset", "annotation", "name", "description", "cached_studyset_id", "cached_annotation_id", "results", "provenance", "project", "run_key", "neurostore_analysis", "cognitive_contrast_cogatlas", "cognitive_contrast_cogatlas_id", "cognitive_paradigm_cogatlas", "cognitive_paradigm_cogatlas_id", "cached_studyset", "cached_annotation", "neurostore_url"] + __properties: ClassVar[List[str]] = ["specification", "studyset", "annotation", "name", "description", "cached_studyset_id", "cached_annotation_id", "results", "provenance", "project", "run_key", "neurostore_analysis", "cognitive_contrast_cogatlas", "cognitive_contrast_cogatlas_id", "cognitive_paradigm_cogatlas", "cognitive_paradigm_cogatlas_id", "cached_studyset", "cached_annotation", "neurostore_url"] + + 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) -> MetaAnalysis: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaAnalysis 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={ - "run_key", - "cached_studyset", - "cached_annotation", - "neurostore_url", - }, - 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([ + "run_key", + "cached_studyset", + "cached_annotation", + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of specification if self.specification: _dict['specification'] = self.specification.to_dict() @@ -96,84 +116,84 @@ def to_dict(self): if self.neurostore_analysis: _dict['neurostore_analysis'] = self.neurostore_analysis.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 provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if cognitive_contrast_cogatlas (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_contrast_cogatlas is None and "cognitive_contrast_cogatlas" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_contrast_cogatlas is None and "cognitive_contrast_cogatlas" in self.model_fields_set: _dict['cognitive_contrast_cogatlas'] = None # set to None if cognitive_contrast_cogatlas_id (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_contrast_cogatlas_id is None and "cognitive_contrast_cogatlas_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_contrast_cogatlas_id is None and "cognitive_contrast_cogatlas_id" in self.model_fields_set: _dict['cognitive_contrast_cogatlas_id'] = None # set to None if cognitive_paradigm_cogatlas (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_paradigm_cogatlas is None and "cognitive_paradigm_cogatlas" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_paradigm_cogatlas is None and "cognitive_paradigm_cogatlas" in self.model_fields_set: _dict['cognitive_paradigm_cogatlas'] = None # set to None if cognitive_paradigm_cogatlas_id (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_paradigm_cogatlas_id is None and "cognitive_paradigm_cogatlas_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_paradigm_cogatlas_id is None and "cognitive_paradigm_cogatlas_id" in self.model_fields_set: _dict['cognitive_paradigm_cogatlas_id'] = None # set to None if cached_studyset (nullable) is None - # and __fields_set__ contains the field - if self.cached_studyset is None and "cached_studyset" in self.__fields_set__: + # and model_fields_set contains the field + if self.cached_studyset is None and "cached_studyset" in self.model_fields_set: _dict['cached_studyset'] = None # set to None if cached_annotation (nullable) is None - # and __fields_set__ contains the field - if self.cached_annotation is None and "cached_annotation" in self.__fields_set__: + # and model_fields_set contains the field + if self.cached_annotation is None and "cached_annotation" in self.model_fields_set: _dict['cached_annotation'] = None # set to None if neurostore_url (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_url is None and "neurostore_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_url is None and "neurostore_url" in self.model_fields_set: _dict['neurostore_url'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysis: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaAnalysis from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaAnalysis.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaAnalysis.parse_obj({ - "specification": MetaAnalysisSpecification.from_dict(obj.get("specification")) if obj.get("specification") is not None else None, - "studyset": MetaAnalysisStudyset.from_dict(obj.get("studyset")) if obj.get("studyset") is not None else None, - "annotation": MetaAnalysisAnnotation.from_dict(obj.get("annotation")) if obj.get("annotation") is not None else None, + _obj = cls.model_validate({ + "specification": MetaAnalysisSpecification.from_dict(obj["specification"]) if obj.get("specification") is not None else None, + "studyset": MetaAnalysisStudyset.from_dict(obj["studyset"]) if obj.get("studyset") is not None else None, + "annotation": MetaAnalysisAnnotation.from_dict(obj["annotation"]) if obj.get("annotation") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "cached_studyset_id": obj.get("cached_studyset_id"), "cached_annotation_id": obj.get("cached_annotation_id"), - "results": MetaAnalysisResults.from_dict(obj.get("results")) if obj.get("results") is not None else None, + "results": MetaAnalysisResults.from_dict(obj["results"]) if obj.get("results") is not None else None, "provenance": obj.get("provenance"), "project": obj.get("project"), "run_key": obj.get("run_key"), - "neurostore_analysis": NeurostoreAnalysis.from_dict(obj.get("neurostore_analysis")) if obj.get("neurostore_analysis") is not None else None, + "neurostore_analysis": NeurostoreAnalysis.from_dict(obj["neurostore_analysis"]) if obj.get("neurostore_analysis") is not None else None, "cognitive_contrast_cogatlas": obj.get("cognitive_contrast_cogatlas"), "cognitive_contrast_cogatlas_id": obj.get("cognitive_contrast_cogatlas_id"), "cognitive_paradigm_cogatlas": obj.get("cognitive_paradigm_cogatlas"), @@ -184,3 +204,4 @@ def from_dict(cls, obj: dict) -> MetaAnalysis: }) return _obj + diff --git a/neurosynth_compose_sdk/models/meta_analysis_annotation.py b/neurosynth_compose_sdk/models/meta_analysis_annotation.py index 2bf6290..04ea23b 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_annotation.py +++ b/neurosynth_compose_sdk/models/meta_analysis_annotation.py @@ -3,27 +3,25 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.annotation import Annotation -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self METAANALYSISANNOTATION_ONE_OF_SCHEMAS = ["Annotation", "str"] @@ -35,13 +33,16 @@ class MetaAnalysisAnnotation(BaseModel): oneof_schema_1_validator: Optional[StrictStr] = None # data type: Annotation oneof_schema_2_validator: Optional[Annotation] = None - actual_instance: Any - one_of_schemas: List[str] = Field(METAANALYSISANNOTATION_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[Annotation, str]] = None + one_of_schemas: Set[str] = { "Annotation", "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 +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 = MetaAnalysisAnnotation.construct() + instance = MetaAnalysisAnnotation.model_construct() error_messages = [] match = 0 # validate data type: str @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysisAnnotation: + 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) -> MetaAnalysisAnnotation: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = MetaAnalysisAnnotation.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], Annotation, 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 @@ -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/neurosynth_compose_sdk/models/meta_analysis_list.py b/neurosynth_compose_sdk/models/meta_analysis_list.py index 1b97dde..8932b06 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_list.py +++ b/neurosynth_compose_sdk/models/meta_analysis_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.meta_analysis_return import MetaAnalysisReturn +from typing import Optional, Set +from typing_extensions import Self class MetaAnalysisList(BaseModel): """ MetaAnalysisList - """ - results: Optional[conlist(MetaAnalysisReturn)] = None + """ # noqa: E501 + results: Optional[List[MetaAnalysisReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> MetaAnalysisList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaAnalysisList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysisList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaAnalysisList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaAnalysisList.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaAnalysisList.parse_obj({ - "results": [MetaAnalysisReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [MetaAnalysisReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/meta_analysis_post_body.py b/neurosynth_compose_sdk/models/meta_analysis_post_body.py index e1be478..fb4762b 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_post_body.py +++ b/neurosynth_compose_sdk/models/meta_analysis_post_body.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,30 +18,31 @@ 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 neurosynth_compose_sdk.models.meta_analysis_annotation import MetaAnalysisAnnotation from neurosynth_compose_sdk.models.meta_analysis_results import MetaAnalysisResults from neurosynth_compose_sdk.models.meta_analysis_specification import MetaAnalysisSpecification from neurosynth_compose_sdk.models.meta_analysis_studyset import MetaAnalysisStudyset from neurosynth_compose_sdk.models.neurostore_analysis import NeurostoreAnalysis +from typing import Optional, Set +from typing_extensions import Self class MetaAnalysisPostBody(BaseModel): """ MetaAnalysisPostBody - """ - specification: MetaAnalysisSpecification = Field(...) + """ # noqa: E501 + specification: MetaAnalysisSpecification studyset: Optional[MetaAnalysisStudyset] = None annotation: Optional[MetaAnalysisAnnotation] = None - name: Optional[StrictStr] = Field(None, description="Human-readable name of the meta-analysis.") - description: Optional[StrictStr] = Field(None, description="Long form description of the meta-analysis.") - cached_studyset_id: StrictStr = Field(..., description="The id of the studyset on neurosynth-compose (as opposed to the id of the studyset on neurostore). Multiple snapshots of the studyset can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") - cached_annotation_id: StrictStr = Field(..., description="The id of the annotation on neurosynth-compose (as opposed to the id of the annotation on neurostore). Multiple snapshots of the annotation can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") + name: Optional[StrictStr] = Field(default=None, description="Human-readable name of the meta-analysis.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the meta-analysis.") + cached_studyset_id: StrictStr = Field(description="The id of the studyset on neurosynth-compose (as opposed to the id of the studyset on neurostore). Multiple snapshots of the studyset can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") + cached_annotation_id: StrictStr = Field(description="The id of the annotation on neurosynth-compose (as opposed to the id of the annotation on neurostore). Multiple snapshots of the annotation can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") results: Optional[MetaAnalysisResults] = None provenance: Optional[Dict[str, Any]] = None project: Optional[StrictStr] = None - run_key: Optional[StrictStr] = Field(None, description="a special key used to upload the results of this meta analysis. Can be used as an alternative to using your auth token from login. ") + run_key: Optional[StrictStr] = Field(default=None, description="a special key used to upload the results of this meta analysis. Can be used as an alternative to using your auth token from login. ") neurostore_analysis: Optional[NeurostoreAnalysis] = None cognitive_contrast_cogatlas: Optional[StrictStr] = None cognitive_contrast_cogatlas_id: Optional[StrictStr] = None @@ -50,36 +51,55 @@ class MetaAnalysisPostBody(BaseModel): cached_studyset: Optional[StrictStr] = None cached_annotation: Optional[StrictStr] = None neurostore_url: Optional[StrictStr] = None - __properties = ["specification", "studyset", "annotation", "name", "description", "cached_studyset_id", "cached_annotation_id", "results", "provenance", "project", "run_key", "neurostore_analysis", "cognitive_contrast_cogatlas", "cognitive_contrast_cogatlas_id", "cognitive_paradigm_cogatlas", "cognitive_paradigm_cogatlas_id", "cached_studyset", "cached_annotation", "neurostore_url"] + __properties: ClassVar[List[str]] = ["specification", "studyset", "annotation", "name", "description", "cached_studyset_id", "cached_annotation_id", "results", "provenance", "project", "run_key", "neurostore_analysis", "cognitive_contrast_cogatlas", "cognitive_contrast_cogatlas_id", "cognitive_paradigm_cogatlas", "cognitive_paradigm_cogatlas_id", "cached_studyset", "cached_annotation", "neurostore_url"] + + 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) -> MetaAnalysisPostBody: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaAnalysisPostBody 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={ - "run_key", - "cached_studyset", - "cached_annotation", - "neurostore_url", - }, - 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([ + "run_key", + "cached_studyset", + "cached_annotation", + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of specification if self.specification: _dict['specification'] = self.specification.to_dict() @@ -96,84 +116,84 @@ def to_dict(self): if self.neurostore_analysis: _dict['neurostore_analysis'] = self.neurostore_analysis.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 provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if cognitive_contrast_cogatlas (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_contrast_cogatlas is None and "cognitive_contrast_cogatlas" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_contrast_cogatlas is None and "cognitive_contrast_cogatlas" in self.model_fields_set: _dict['cognitive_contrast_cogatlas'] = None # set to None if cognitive_contrast_cogatlas_id (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_contrast_cogatlas_id is None and "cognitive_contrast_cogatlas_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_contrast_cogatlas_id is None and "cognitive_contrast_cogatlas_id" in self.model_fields_set: _dict['cognitive_contrast_cogatlas_id'] = None # set to None if cognitive_paradigm_cogatlas (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_paradigm_cogatlas is None and "cognitive_paradigm_cogatlas" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_paradigm_cogatlas is None and "cognitive_paradigm_cogatlas" in self.model_fields_set: _dict['cognitive_paradigm_cogatlas'] = None # set to None if cognitive_paradigm_cogatlas_id (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_paradigm_cogatlas_id is None and "cognitive_paradigm_cogatlas_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_paradigm_cogatlas_id is None and "cognitive_paradigm_cogatlas_id" in self.model_fields_set: _dict['cognitive_paradigm_cogatlas_id'] = None # set to None if cached_studyset (nullable) is None - # and __fields_set__ contains the field - if self.cached_studyset is None and "cached_studyset" in self.__fields_set__: + # and model_fields_set contains the field + if self.cached_studyset is None and "cached_studyset" in self.model_fields_set: _dict['cached_studyset'] = None # set to None if cached_annotation (nullable) is None - # and __fields_set__ contains the field - if self.cached_annotation is None and "cached_annotation" in self.__fields_set__: + # and model_fields_set contains the field + if self.cached_annotation is None and "cached_annotation" in self.model_fields_set: _dict['cached_annotation'] = None # set to None if neurostore_url (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_url is None and "neurostore_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_url is None and "neurostore_url" in self.model_fields_set: _dict['neurostore_url'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysisPostBody: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaAnalysisPostBody from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaAnalysisPostBody.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaAnalysisPostBody.parse_obj({ - "specification": MetaAnalysisSpecification.from_dict(obj.get("specification")) if obj.get("specification") is not None else None, - "studyset": MetaAnalysisStudyset.from_dict(obj.get("studyset")) if obj.get("studyset") is not None else None, - "annotation": MetaAnalysisAnnotation.from_dict(obj.get("annotation")) if obj.get("annotation") is not None else None, + _obj = cls.model_validate({ + "specification": MetaAnalysisSpecification.from_dict(obj["specification"]) if obj.get("specification") is not None else None, + "studyset": MetaAnalysisStudyset.from_dict(obj["studyset"]) if obj.get("studyset") is not None else None, + "annotation": MetaAnalysisAnnotation.from_dict(obj["annotation"]) if obj.get("annotation") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "cached_studyset_id": obj.get("cached_studyset_id"), "cached_annotation_id": obj.get("cached_annotation_id"), - "results": MetaAnalysisResults.from_dict(obj.get("results")) if obj.get("results") is not None else None, + "results": MetaAnalysisResults.from_dict(obj["results"]) if obj.get("results") is not None else None, "provenance": obj.get("provenance"), "project": obj.get("project"), "run_key": obj.get("run_key"), - "neurostore_analysis": NeurostoreAnalysis.from_dict(obj.get("neurostore_analysis")) if obj.get("neurostore_analysis") is not None else None, + "neurostore_analysis": NeurostoreAnalysis.from_dict(obj["neurostore_analysis"]) if obj.get("neurostore_analysis") is not None else None, "cognitive_contrast_cogatlas": obj.get("cognitive_contrast_cogatlas"), "cognitive_contrast_cogatlas_id": obj.get("cognitive_contrast_cogatlas_id"), "cognitive_paradigm_cogatlas": obj.get("cognitive_paradigm_cogatlas"), @@ -184,3 +204,4 @@ def from_dict(cls, obj: dict) -> MetaAnalysisPostBody: }) return _obj + diff --git a/neurosynth_compose_sdk/models/meta_analysis_results.py b/neurosynth_compose_sdk/models/meta_analysis_results.py index 61b332a..8fdd8bf 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_results.py +++ b/neurosynth_compose_sdk/models/meta_analysis_results.py @@ -3,27 +3,26 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.result_return import ResultReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self METAANALYSISRESULTS_ONE_OF_SCHEMAS = ["List[ResultReturn]", "List[str]"] @@ -32,16 +31,19 @@ class MetaAnalysisResults(BaseModel): array of neurostore ids representing the results of this meta-analysis (nominally all results should be the same, but machine architecture differences/algorithm stochastic-ness may lead to slightly different outcomes for each result. """ # data type: List[ResultReturn] - oneof_schema_1_validator: Optional[conlist(ResultReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[ResultReturn], 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(METAANALYSISRESULTS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[ResultReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[ResultReturn]", "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 = MetaAnalysisResults.construct() + instance = MetaAnalysisResults.model_construct() error_messages = [] match = 0 # validate data type: List[ResultReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysisResults: + 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) -> MetaAnalysisResults: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = MetaAnalysisResults.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[ResultReturn], 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/neurosynth_compose_sdk/models/meta_analysis_return.py b/neurosynth_compose_sdk/models/meta_analysis_return.py index 7a19f0a..301d1d2 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_return.py +++ b/neurosynth_compose_sdk/models/meta_analysis_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,29 +19,31 @@ 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 neurosynth_compose_sdk.models.meta_analysis_annotation import MetaAnalysisAnnotation from neurosynth_compose_sdk.models.meta_analysis_results import MetaAnalysisResults from neurosynth_compose_sdk.models.meta_analysis_specification import MetaAnalysisSpecification from neurosynth_compose_sdk.models.meta_analysis_studyset import MetaAnalysisStudyset from neurosynth_compose_sdk.models.neurostore_analysis import NeurostoreAnalysis +from typing import Optional, Set +from typing_extensions import Self class MetaAnalysisReturn(BaseModel): """ MetaAnalysisReturn - """ + """ # noqa: E501 specification: Optional[MetaAnalysisSpecification] = None studyset: Optional[MetaAnalysisStudyset] = None annotation: Optional[MetaAnalysisAnnotation] = None - name: Optional[StrictStr] = Field(None, description="Human-readable name of the meta-analysis.") - description: Optional[StrictStr] = Field(None, description="Long form description of the meta-analysis.") - cached_studyset_id: Optional[StrictStr] = Field(None, description="The id of the studyset on neurosynth-compose (as opposed to the id of the studyset on neurostore). Multiple snapshots of the studyset can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") - cached_annotation_id: Optional[StrictStr] = Field(None, description="The id of the annotation on neurosynth-compose (as opposed to the id of the annotation on neurostore). Multiple snapshots of the annotation can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") + name: Optional[StrictStr] = Field(default=None, description="Human-readable name of the meta-analysis.") + description: Optional[StrictStr] = Field(default=None, description="Long form description of the meta-analysis.") + cached_studyset_id: Optional[StrictStr] = Field(default=None, description="The id of the studyset on neurosynth-compose (as opposed to the id of the studyset on neurostore). Multiple snapshots of the studyset can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") + cached_annotation_id: Optional[StrictStr] = Field(default=None, description="The id of the annotation on neurosynth-compose (as opposed to the id of the annotation on neurostore). Multiple snapshots of the annotation can be stored on neurosynth-compose so knowing which snapshot is being referenced is necessary.") results: Optional[MetaAnalysisResults] = None provenance: Optional[Dict[str, Any]] = None project: Optional[StrictStr] = None - run_key: Optional[StrictStr] = Field(None, description="a special key used to upload the results of this meta analysis. Can be used as an alternative to using your auth token from login. ") + run_key: Optional[StrictStr] = Field(default=None, description="a special key used to upload the results of this meta analysis. Can be used as an alternative to using your auth token from login. ") neurostore_analysis: Optional[NeurostoreAnalysis] = None cognitive_contrast_cogatlas: Optional[StrictStr] = None cognitive_contrast_cogatlas_id: Optional[StrictStr] = None @@ -50,44 +52,66 @@ class MetaAnalysisReturn(BaseModel): cached_studyset: Optional[StrictStr] = None cached_annotation: Optional[StrictStr] = None neurostore_url: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["specification", "studyset", "annotation", "name", "description", "cached_studyset_id", "cached_annotation_id", "results", "provenance", "project", "run_key", "neurostore_analysis", "cognitive_contrast_cogatlas", "cognitive_contrast_cogatlas_id", "cognitive_paradigm_cogatlas", "cognitive_paradigm_cogatlas_id", "cached_studyset", "cached_annotation", "neurostore_url", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["specification", "studyset", "annotation", "name", "description", "cached_studyset_id", "cached_annotation_id", "results", "provenance", "project", "run_key", "neurostore_analysis", "cognitive_contrast_cogatlas", "cognitive_contrast_cogatlas_id", "cognitive_paradigm_cogatlas", "cognitive_paradigm_cogatlas_id", "cached_studyset", "cached_annotation", "neurostore_url", "id", "updated_at", "created_at", "user", "username"] + + 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) -> MetaAnalysisReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MetaAnalysisReturn 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={ - "run_key", - "cached_studyset", - "cached_annotation", - "neurostore_url", - "updated_at", - "created_at", - "username", - }, - 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. + """ + excluded_fields: Set[str] = set([ + "run_key", + "cached_studyset", + "cached_annotation", + "neurostore_url", + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of specification if self.specification: _dict['specification'] = self.specification.to_dict() @@ -104,99 +128,99 @@ def to_dict(self): if self.neurostore_analysis: _dict['neurostore_analysis'] = self.neurostore_analysis.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 provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if cognitive_contrast_cogatlas (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_contrast_cogatlas is None and "cognitive_contrast_cogatlas" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_contrast_cogatlas is None and "cognitive_contrast_cogatlas" in self.model_fields_set: _dict['cognitive_contrast_cogatlas'] = None # set to None if cognitive_contrast_cogatlas_id (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_contrast_cogatlas_id is None and "cognitive_contrast_cogatlas_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_contrast_cogatlas_id is None and "cognitive_contrast_cogatlas_id" in self.model_fields_set: _dict['cognitive_contrast_cogatlas_id'] = None # set to None if cognitive_paradigm_cogatlas (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_paradigm_cogatlas is None and "cognitive_paradigm_cogatlas" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_paradigm_cogatlas is None and "cognitive_paradigm_cogatlas" in self.model_fields_set: _dict['cognitive_paradigm_cogatlas'] = None # set to None if cognitive_paradigm_cogatlas_id (nullable) is None - # and __fields_set__ contains the field - if self.cognitive_paradigm_cogatlas_id is None and "cognitive_paradigm_cogatlas_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.cognitive_paradigm_cogatlas_id is None and "cognitive_paradigm_cogatlas_id" in self.model_fields_set: _dict['cognitive_paradigm_cogatlas_id'] = None # set to None if cached_studyset (nullable) is None - # and __fields_set__ contains the field - if self.cached_studyset is None and "cached_studyset" in self.__fields_set__: + # and model_fields_set contains the field + if self.cached_studyset is None and "cached_studyset" in self.model_fields_set: _dict['cached_studyset'] = None # set to None if cached_annotation (nullable) is None - # and __fields_set__ contains the field - if self.cached_annotation is None and "cached_annotation" in self.__fields_set__: + # and model_fields_set contains the field + if self.cached_annotation is None and "cached_annotation" in self.model_fields_set: _dict['cached_annotation'] = None # set to None if neurostore_url (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_url is None and "neurostore_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_url is None and "neurostore_url" in self.model_fields_set: _dict['neurostore_url'] = 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) -> MetaAnalysisReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MetaAnalysisReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MetaAnalysisReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = MetaAnalysisReturn.parse_obj({ - "specification": MetaAnalysisSpecification.from_dict(obj.get("specification")) if obj.get("specification") is not None else None, - "studyset": MetaAnalysisStudyset.from_dict(obj.get("studyset")) if obj.get("studyset") is not None else None, - "annotation": MetaAnalysisAnnotation.from_dict(obj.get("annotation")) if obj.get("annotation") is not None else None, + _obj = cls.model_validate({ + "specification": MetaAnalysisSpecification.from_dict(obj["specification"]) if obj.get("specification") is not None else None, + "studyset": MetaAnalysisStudyset.from_dict(obj["studyset"]) if obj.get("studyset") is not None else None, + "annotation": MetaAnalysisAnnotation.from_dict(obj["annotation"]) if obj.get("annotation") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "cached_studyset_id": obj.get("cached_studyset_id"), "cached_annotation_id": obj.get("cached_annotation_id"), - "results": MetaAnalysisResults.from_dict(obj.get("results")) if obj.get("results") is not None else None, + "results": MetaAnalysisResults.from_dict(obj["results"]) if obj.get("results") is not None else None, "provenance": obj.get("provenance"), "project": obj.get("project"), "run_key": obj.get("run_key"), - "neurostore_analysis": NeurostoreAnalysis.from_dict(obj.get("neurostore_analysis")) if obj.get("neurostore_analysis") is not None else None, + "neurostore_analysis": NeurostoreAnalysis.from_dict(obj["neurostore_analysis"]) if obj.get("neurostore_analysis") is not None else None, "cognitive_contrast_cogatlas": obj.get("cognitive_contrast_cogatlas"), "cognitive_contrast_cogatlas_id": obj.get("cognitive_contrast_cogatlas_id"), "cognitive_paradigm_cogatlas": obj.get("cognitive_paradigm_cogatlas"), @@ -212,3 +236,4 @@ def from_dict(cls, obj: dict) -> MetaAnalysisReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/meta_analysis_specification.py b/neurosynth_compose_sdk/models/meta_analysis_specification.py index f448a2b..c5806cd 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_specification.py +++ b/neurosynth_compose_sdk/models/meta_analysis_specification.py @@ -3,27 +3,25 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.specification import Specification -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self METAANALYSISSPECIFICATION_ONE_OF_SCHEMAS = ["Specification", "str"] @@ -35,13 +33,16 @@ class MetaAnalysisSpecification(BaseModel): oneof_schema_1_validator: Optional[StrictStr] = None # data type: Specification oneof_schema_2_validator: Optional[Specification] = None - actual_instance: Any - one_of_schemas: List[str] = Field(METAANALYSISSPECIFICATION_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[Specification, str]] = None + one_of_schemas: Set[str] = { "Specification", "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 +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 = MetaAnalysisSpecification.construct() + instance = MetaAnalysisSpecification.model_construct() error_messages = [] match = 0 # validate data type: str @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysisSpecification: + 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) -> MetaAnalysisSpecification: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = MetaAnalysisSpecification.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], Specification, 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 @@ -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/neurosynth_compose_sdk/models/meta_analysis_studyset.py b/neurosynth_compose_sdk/models/meta_analysis_studyset.py index b4fb038..9377049 100644 --- a/neurosynth_compose_sdk/models/meta_analysis_studyset.py +++ b/neurosynth_compose_sdk/models/meta_analysis_studyset.py @@ -3,27 +3,25 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.studyset import Studyset -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self METAANALYSISSTUDYSET_ONE_OF_SCHEMAS = ["Studyset", "str"] @@ -35,13 +33,16 @@ class MetaAnalysisStudyset(BaseModel): oneof_schema_1_validator: Optional[StrictStr] = None # data type: Studyset oneof_schema_2_validator: Optional[Studyset] = None - actual_instance: Any - one_of_schemas: List[str] = Field(METAANALYSISSTUDYSET_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[Studyset, str]] = None + one_of_schemas: Set[str] = { "Studyset", "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 +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 = MetaAnalysisStudyset.construct() + instance = MetaAnalysisStudyset.model_construct() error_messages = [] match = 0 # validate data type: str @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> MetaAnalysisStudyset: + 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) -> MetaAnalysisStudyset: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = MetaAnalysisStudyset.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], Studyset, 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 @@ -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/neurosynth_compose_sdk/models/neurostore_analysis.py b/neurosynth_compose_sdk/models/neurostore_analysis.py index 472e10f..efbba73 100644 --- a/neurosynth_compose_sdk/models/neurostore_analysis.py +++ b/neurosynth_compose_sdk/models/neurostore_analysis.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,77 +18,94 @@ 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 NeurostoreAnalysis(BaseModel): """ NeurostoreAnalysis - """ + """ # noqa: E501 neurostore_id: Optional[StrictStr] = None exception: Optional[StrictStr] = None traceback: Optional[StrictStr] = None status: Optional[StrictStr] = None - __properties = ["neurostore_id", "exception", "traceback", "status"] + __properties: ClassVar[List[str]] = ["neurostore_id", "exception", "traceback", "status"] + + 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) -> NeurostoreAnalysis: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurostoreAnalysis 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={ - "neurostore_id", - }, - 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([ + "neurostore_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if neurostore_id (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_id is None and "neurostore_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_id is None and "neurostore_id" in self.model_fields_set: _dict['neurostore_id'] = None # set to None if exception (nullable) is None - # and __fields_set__ contains the field - if self.exception is None and "exception" in self.__fields_set__: + # and model_fields_set contains the field + if self.exception is None and "exception" in self.model_fields_set: _dict['exception'] = None # set to None if traceback (nullable) is None - # and __fields_set__ contains the field - if self.traceback is None and "traceback" in self.__fields_set__: + # and model_fields_set contains the field + if self.traceback is None and "traceback" in self.model_fields_set: _dict['traceback'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurostoreAnalysis: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurostoreAnalysis from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurostoreAnalysis.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurostoreAnalysis.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), "exception": obj.get("exception"), "traceback": obj.get("traceback"), @@ -96,3 +113,4 @@ def from_dict(cls, obj: dict) -> NeurostoreAnalysis: }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurostore_study.py b/neurosynth_compose_sdk/models/neurostore_study.py index d8e6fb4..b8713df 100644 --- a/neurosynth_compose_sdk/models/neurostore_study.py +++ b/neurosynth_compose_sdk/models/neurostore_study.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,91 +18,109 @@ 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 neurosynth_compose_sdk.models.neurostore_analysis import NeurostoreAnalysis +from typing import Optional, Set +from typing_extensions import Self class NeurostoreStudy(BaseModel): """ NeurostoreStudy - """ + """ # noqa: E501 neurostore_id: Optional[StrictStr] = None - analyses: Optional[conlist(NeurostoreAnalysis)] = None + analyses: Optional[List[NeurostoreAnalysis]] = None exception: Optional[StrictStr] = None traceback: Optional[StrictStr] = None status: Optional[StrictStr] = None - __properties = ["neurostore_id", "analyses", "exception", "traceback", "status"] + __properties: ClassVar[List[str]] = ["neurostore_id", "analyses", "exception", "traceback", "status"] + + 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) -> NeurostoreStudy: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurostoreStudy 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={ - "neurostore_id", - }, - 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([ + "neurostore_id", + ]) + + _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 analyses (list) _items = [] if self.analyses: - for _item in self.analyses: - if _item: - _items.append(_item.to_dict()) + for _item_analyses in self.analyses: + if _item_analyses: + _items.append(_item_analyses.to_dict()) _dict['analyses'] = _items # set to None if neurostore_id (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_id is None and "neurostore_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_id is None and "neurostore_id" in self.model_fields_set: _dict['neurostore_id'] = None # set to None if exception (nullable) is None - # and __fields_set__ contains the field - if self.exception is None and "exception" in self.__fields_set__: + # and model_fields_set contains the field + if self.exception is None and "exception" in self.model_fields_set: _dict['exception'] = None # set to None if traceback (nullable) is None - # and __fields_set__ contains the field - if self.traceback is None and "traceback" in self.__fields_set__: + # and model_fields_set contains the field + if self.traceback is None and "traceback" in self.model_fields_set: _dict['traceback'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurostoreStudy: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurostoreStudy from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurostoreStudy.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurostoreStudy.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), - "analyses": [NeurostoreAnalysis.from_dict(_item) for _item in obj.get("analyses")] if obj.get("analyses") is not None else None, + "analyses": [NeurostoreAnalysis.from_dict(_item) for _item in obj["analyses"]] if obj.get("analyses") is not None else None, "exception": obj.get("exception"), "traceback": obj.get("traceback"), "status": obj.get("status") }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurostore_study_list.py b/neurosynth_compose_sdk/models/neurostore_study_list.py index bc60629..56d0962 100644 --- a/neurosynth_compose_sdk/models/neurostore_study_list.py +++ b/neurosynth_compose_sdk/models/neurostore_study_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.neurostore_study_return import NeurostoreStudyReturn +from typing import Optional, Set +from typing_extensions import Self class NeurostoreStudyList(BaseModel): """ NeurostoreStudyList - """ - results: Optional[conlist(NeurostoreStudyReturn)] = None + """ # noqa: E501 + results: Optional[List[NeurostoreStudyReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> NeurostoreStudyList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurostoreStudyList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurostoreStudyList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurostoreStudyList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurostoreStudyList.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurostoreStudyList.parse_obj({ - "results": [NeurostoreStudyReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [NeurostoreStudyReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurostore_study_return.py b/neurosynth_compose_sdk/models/neurostore_study_return.py index 9a4050e..68a4223 100644 --- a/neurosynth_compose_sdk/models/neurostore_study_return.py +++ b/neurosynth_compose_sdk/models/neurostore_study_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,110 +19,131 @@ import json from datetime import datetime -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.neurostore_analysis import NeurostoreAnalysis +from typing import Optional, Set +from typing_extensions import Self class NeurostoreStudyReturn(BaseModel): """ NeurostoreStudyReturn - """ + """ # noqa: E501 neurostore_id: Optional[StrictStr] = None - analyses: Optional[conlist(NeurostoreAnalysis)] = None + analyses: Optional[List[NeurostoreAnalysis]] = None exception: Optional[StrictStr] = None traceback: Optional[StrictStr] = None status: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["neurostore_id", "analyses", "exception", "traceback", "status", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["neurostore_id", "analyses", "exception", "traceback", "status", "id", "updated_at", "created_at", "user", "username"] + + 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) -> NeurostoreStudyReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurostoreStudyReturn 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={ - "neurostore_id", - "updated_at", - "created_at", - "username", - }, - 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([ + "neurostore_id", + "updated_at", + "created_at", + "username", + ]) + + _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 analyses (list) _items = [] if self.analyses: - for _item in self.analyses: - if _item: - _items.append(_item.to_dict()) + for _item_analyses in self.analyses: + if _item_analyses: + _items.append(_item_analyses.to_dict()) _dict['analyses'] = _items # set to None if neurostore_id (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_id is None and "neurostore_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_id is None and "neurostore_id" in self.model_fields_set: _dict['neurostore_id'] = None # set to None if exception (nullable) is None - # and __fields_set__ contains the field - if self.exception is None and "exception" in self.__fields_set__: + # and model_fields_set contains the field + if self.exception is None and "exception" in self.model_fields_set: _dict['exception'] = None # set to None if traceback (nullable) is None - # and __fields_set__ contains the field - if self.traceback is None and "traceback" in self.__fields_set__: + # and model_fields_set contains the field + if self.traceback is None and "traceback" in self.model_fields_set: _dict['traceback'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = 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) -> NeurostoreStudyReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurostoreStudyReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurostoreStudyReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurostoreStudyReturn.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), - "analyses": [NeurostoreAnalysis.from_dict(_item) for _item in obj.get("analyses")] if obj.get("analyses") is not None else None, + "analyses": [NeurostoreAnalysis.from_dict(_item) for _item in obj["analyses"]] if obj.get("analyses") is not None else None, "exception": obj.get("exception"), "traceback": obj.get("traceback"), "status": obj.get("status"), @@ -134,3 +155,4 @@ def from_dict(cls, obj: dict) -> NeurostoreStudyReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurovault_collection.py b/neurosynth_compose_sdk/models/neurovault_collection.py index 93750db..0dde3fb 100644 --- a/neurosynth_compose_sdk/models/neurovault_collection.py +++ b/neurosynth_compose_sdk/models/neurovault_collection.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,91 @@ 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 neurosynth_compose_sdk.models.neurovault_collection_files import NeurovaultCollectionFiles +from typing import Optional, Set +from typing_extensions import Self class NeurovaultCollection(BaseModel): """ NeurovaultCollection - """ + """ # noqa: E501 collection_id: Optional[StrictStr] = None files: Optional[NeurovaultCollectionFiles] = None url: Optional[StrictStr] = None - __properties = ["collection_id", "files", "url"] + __properties: ClassVar[List[str]] = ["collection_id", "files", "url"] + + 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) -> NeurovaultCollection: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurovaultCollection 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={ - "collection_id", - }, - 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([ + "collection_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of files if self.files: _dict['files'] = self.files.to_dict() # set to None if collection_id (nullable) is None - # and __fields_set__ contains the field - if self.collection_id is None and "collection_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.collection_id is None and "collection_id" in self.model_fields_set: _dict['collection_id'] = 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurovaultCollection: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurovaultCollection from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurovaultCollection.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurovaultCollection.parse_obj({ + _obj = cls.model_validate({ "collection_id": obj.get("collection_id"), - "files": NeurovaultCollectionFiles.from_dict(obj.get("files")) if obj.get("files") is not None else None, + "files": NeurovaultCollectionFiles.from_dict(obj["files"]) if obj.get("files") is not None else None, "url": obj.get("url") }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurovault_collection_files.py b/neurosynth_compose_sdk/models/neurovault_collection_files.py index 2db749a..63a31c3 100644 --- a/neurosynth_compose_sdk/models/neurovault_collection_files.py +++ b/neurosynth_compose_sdk/models/neurovault_collection_files.py @@ -3,27 +3,26 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.neurovault_file import NeurovaultFile -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self NEUROVAULTCOLLECTIONFILES_ONE_OF_SCHEMAS = ["List[NeurovaultFile]", "List[str]"] @@ -32,16 +31,19 @@ class NeurovaultCollectionFiles(BaseModel): NeurovaultCollectionFiles """ # data type: List[NeurovaultFile] - oneof_schema_1_validator: Optional[conlist(NeurovaultFile, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[NeurovaultFile], 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(NEUROVAULTCOLLECTIONFILES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[NeurovaultFile], List[str]]] = None + one_of_schemas: Set[str] = { "List[NeurovaultFile]", "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 = NeurovaultCollectionFiles.construct() + instance = NeurovaultCollectionFiles.model_construct() error_messages = [] match = 0 # validate data type: List[NeurovaultFile] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> NeurovaultCollectionFiles: + 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) -> NeurovaultCollectionFiles: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = NeurovaultCollectionFiles.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[NeurovaultFile], 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/neurosynth_compose_sdk/models/neurovault_collection_return.py b/neurosynth_compose_sdk/models/neurovault_collection_return.py index c679f40..447abef 100644 --- a/neurosynth_compose_sdk/models/neurovault_collection_return.py +++ b/neurosynth_compose_sdk/models/neurovault_collection_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,94 +19,115 @@ import json from datetime import datetime -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 neurosynth_compose_sdk.models.neurovault_collection_files import NeurovaultCollectionFiles +from typing import Optional, Set +from typing_extensions import Self class NeurovaultCollectionReturn(BaseModel): """ NeurovaultCollectionReturn - """ + """ # noqa: E501 collection_id: Optional[StrictStr] = None files: Optional[NeurovaultCollectionFiles] = None url: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["collection_id", "files", "url", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["collection_id", "files", "url", "id", "updated_at", "created_at", "user", "username"] + + 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) -> NeurovaultCollectionReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurovaultCollectionReturn 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={ - "collection_id", - "updated_at", - "created_at", - "username", - }, - 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([ + "collection_id", + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of files if self.files: _dict['files'] = self.files.to_dict() # set to None if collection_id (nullable) is None - # and __fields_set__ contains the field - if self.collection_id is None and "collection_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.collection_id is None and "collection_id" in self.model_fields_set: _dict['collection_id'] = 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 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) -> NeurovaultCollectionReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurovaultCollectionReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurovaultCollectionReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurovaultCollectionReturn.parse_obj({ + _obj = cls.model_validate({ "collection_id": obj.get("collection_id"), - "files": NeurovaultCollectionFiles.from_dict(obj.get("files")) if obj.get("files") is not None else None, + "files": NeurovaultCollectionFiles.from_dict(obj["files"]) if obj.get("files") is not None else None, "url": obj.get("url"), "id": obj.get("id"), "updated_at": obj.get("updated_at"), @@ -116,3 +137,4 @@ def from_dict(cls, obj: dict) -> NeurovaultCollectionReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurovault_file.py b/neurosynth_compose_sdk/models/neurovault_file.py index 67bab99..9191891 100644 --- a/neurosynth_compose_sdk/models/neurovault_file.py +++ b/neurosynth_compose_sdk/models/neurovault_file.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,14 +18,15 @@ 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 NeurovaultFile(BaseModel): """ NeurovaultFile - """ + """ # noqa: E501 collection_id: Optional[StrictStr] = None exception: Optional[StrictStr] = None traceback: Optional[StrictStr] = None @@ -33,74 +34,89 @@ class NeurovaultFile(BaseModel): image_id: Optional[StrictStr] = None name: Optional[StrictStr] = None url: Optional[StrictStr] = None - __properties = ["collection_id", "exception", "traceback", "status", "image_id", "name", "url"] + __properties: ClassVar[List[str]] = ["collection_id", "exception", "traceback", "status", "image_id", "name", "url"] + + 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) -> NeurovaultFile: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurovaultFile 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 collection_id (nullable) is None - # and __fields_set__ contains the field - if self.collection_id is None and "collection_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.collection_id is None and "collection_id" in self.model_fields_set: _dict['collection_id'] = None # set to None if exception (nullable) is None - # and __fields_set__ contains the field - if self.exception is None and "exception" in self.__fields_set__: + # and model_fields_set contains the field + if self.exception is None and "exception" in self.model_fields_set: _dict['exception'] = None # set to None if traceback (nullable) is None - # and __fields_set__ contains the field - if self.traceback is None and "traceback" in self.__fields_set__: + # and model_fields_set contains the field + if self.traceback is None and "traceback" in self.model_fields_set: _dict['traceback'] = None # set to None if image_id (nullable) is None - # and __fields_set__ contains the field - if self.image_id is None and "image_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.image_id is None and "image_id" in self.model_fields_set: _dict['image_id'] = 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 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurovaultFile: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurovaultFile from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurovaultFile.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurovaultFile.parse_obj({ + _obj = cls.model_validate({ "collection_id": obj.get("collection_id"), "exception": obj.get("exception"), "traceback": obj.get("traceback"), @@ -111,3 +127,4 @@ def from_dict(cls, obj: dict) -> NeurovaultFile: }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurovault_file_list.py b/neurosynth_compose_sdk/models/neurovault_file_list.py index 3a6f2e0..beb9e79 100644 --- a/neurosynth_compose_sdk/models/neurovault_file_list.py +++ b/neurosynth_compose_sdk/models/neurovault_file_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.neurovault_file_return import NeurovaultFileReturn +from typing import Optional, Set +from typing_extensions import Self class NeurovaultFileList(BaseModel): """ NeurovaultFileList - """ - results: Optional[conlist(NeurovaultFileReturn)] = None + """ # noqa: E501 + results: Optional[List[NeurovaultFileReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> NeurovaultFileList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurovaultFileList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurovaultFileList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurovaultFileList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurovaultFileList.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurovaultFileList.parse_obj({ - "results": [NeurovaultFileReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [NeurovaultFileReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurovault_file_return.py b/neurosynth_compose_sdk/models/neurovault_file_return.py index ad1b6fd..10f590b 100644 --- a/neurosynth_compose_sdk/models/neurovault_file_return.py +++ b/neurosynth_compose_sdk/models/neurovault_file_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,13 +19,15 @@ import json from datetime import datetime -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 NeurovaultFileReturn(BaseModel): """ NeurovaultFileReturn - """ + """ # noqa: E501 collection_id: Optional[StrictStr] = None exception: Optional[StrictStr] = None traceback: Optional[StrictStr] = None @@ -33,97 +35,115 @@ class NeurovaultFileReturn(BaseModel): image_id: Optional[StrictStr] = None name: Optional[StrictStr] = None url: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["collection_id", "exception", "traceback", "status", "image_id", "name", "url", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["collection_id", "exception", "traceback", "status", "image_id", "name", "url", "id", "updated_at", "created_at", "user", "username"] + + 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) -> NeurovaultFileReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurovaultFileReturn 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={ - "updated_at", - "created_at", - "username", - }, - 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([ + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if collection_id (nullable) is None - # and __fields_set__ contains the field - if self.collection_id is None and "collection_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.collection_id is None and "collection_id" in self.model_fields_set: _dict['collection_id'] = None # set to None if exception (nullable) is None - # and __fields_set__ contains the field - if self.exception is None and "exception" in self.__fields_set__: + # and model_fields_set contains the field + if self.exception is None and "exception" in self.model_fields_set: _dict['exception'] = None # set to None if traceback (nullable) is None - # and __fields_set__ contains the field - if self.traceback is None and "traceback" in self.__fields_set__: + # and model_fields_set contains the field + if self.traceback is None and "traceback" in self.model_fields_set: _dict['traceback'] = None # set to None if image_id (nullable) is None - # and __fields_set__ contains the field - if self.image_id is None and "image_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.image_id is None and "image_id" in self.model_fields_set: _dict['image_id'] = 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 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 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) -> NeurovaultFileReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurovaultFileReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurovaultFileReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurovaultFileReturn.parse_obj({ + _obj = cls.model_validate({ "collection_id": obj.get("collection_id"), "exception": obj.get("exception"), "traceback": obj.get("traceback"), @@ -139,3 +159,4 @@ def from_dict(cls, obj: dict) -> NeurovaultFileReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/neurovault_list.py b/neurosynth_compose_sdk/models/neurovault_list.py index 25776ba..8fca7fa 100644 --- a/neurosynth_compose_sdk/models/neurovault_list.py +++ b/neurosynth_compose_sdk/models/neurovault_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn +from typing import Optional, Set +from typing_extensions import Self class NeurovaultList(BaseModel): """ NeurovaultList - """ - results: Optional[conlist(NeurovaultCollectionReturn)] = None + """ # noqa: E501 + results: Optional[List[NeurovaultCollectionReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> NeurovaultList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of NeurovaultList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> NeurovaultList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of NeurovaultList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return NeurovaultList.parse_obj(obj) + return cls.model_validate(obj) - _obj = NeurovaultList.parse_obj({ - "results": [NeurovaultCollectionReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [NeurovaultCollectionReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/project.py b/neurosynth_compose_sdk/models/project.py index 66a567f..c99f36e 100644 --- a/neurosynth_compose_sdk/models/project.py +++ b/neurosynth_compose_sdk/models/project.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,51 +18,68 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.neurostore_study import NeurostoreStudy from neurosynth_compose_sdk.models.project_meta_analyses import ProjectMetaAnalyses +from typing import Optional, Set +from typing_extensions import Self class Project(BaseModel): """ Project - """ + """ # noqa: E501 provenance: Optional[Dict[str, Any]] = None meta_analyses: Optional[ProjectMetaAnalyses] = None name: Optional[StrictStr] = None description: Optional[StrictStr] = None - public: Optional[StrictBool] = Field(None, description="whether the project is public or private") + public: Optional[StrictBool] = Field(default=None, description="whether the project is public or private") neurostore_study: Optional[NeurostoreStudy] = None neurostore_url: Optional[StrictStr] = None draft: Optional[StrictBool] = None - __properties = ["provenance", "meta_analyses", "name", "description", "public", "neurostore_study", "neurostore_url", "draft"] + __properties: ClassVar[List[str]] = ["provenance", "meta_analyses", "name", "description", "public", "neurostore_study", "neurostore_url", "draft"] + + 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) -> Project: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Project 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={ - "draft", - }, - 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([ + "draft", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of meta_analyses if self.meta_analyses: _dict['meta_analyses'] = self.meta_analyses.to_dict() @@ -70,45 +87,46 @@ def to_dict(self): if self.neurostore_study: _dict['neurostore_study'] = self.neurostore_study.to_dict() # set to None if provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = 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 neurostore_url (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_url is None and "neurostore_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_url is None and "neurostore_url" in self.model_fields_set: _dict['neurostore_url'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Project: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Project from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Project.parse_obj(obj) + return cls.model_validate(obj) - _obj = Project.parse_obj({ + _obj = cls.model_validate({ "provenance": obj.get("provenance"), - "meta_analyses": ProjectMetaAnalyses.from_dict(obj.get("meta_analyses")) if obj.get("meta_analyses") is not None else None, + "meta_analyses": ProjectMetaAnalyses.from_dict(obj["meta_analyses"]) if obj.get("meta_analyses") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "public": obj.get("public"), - "neurostore_study": NeurostoreStudy.from_dict(obj.get("neurostore_study")) if obj.get("neurostore_study") is not None else None, + "neurostore_study": NeurostoreStudy.from_dict(obj["neurostore_study"]) if obj.get("neurostore_study") is not None else None, "neurostore_url": obj.get("neurostore_url"), "draft": obj.get("draft") }) return _obj + diff --git a/neurosynth_compose_sdk/models/project_list.py b/neurosynth_compose_sdk/models/project_list.py index ff697a0..29ebbfa 100644 --- a/neurosynth_compose_sdk/models/project_list.py +++ b/neurosynth_compose_sdk/models/project_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.project_return import ProjectReturn +from typing import Optional, Set +from typing_extensions import Self class ProjectList(BaseModel): """ ProjectList - """ - results: Optional[conlist(ProjectReturn)] = None + """ # noqa: E501 + results: Optional[List[ProjectReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> ProjectList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> ProjectList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectList.parse_obj({ - "results": [ProjectReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [ProjectReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/project_meta_analyses.py b/neurosynth_compose_sdk/models/project_meta_analyses.py index aa724f5..09366fe 100644 --- a/neurosynth_compose_sdk/models/project_meta_analyses.py +++ b/neurosynth_compose_sdk/models/project_meta_analyses.py @@ -3,27 +3,26 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.meta_analysis import MetaAnalysis -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self PROJECTMETAANALYSES_ONE_OF_SCHEMAS = ["List[MetaAnalysis]", "List[str]"] @@ -32,16 +31,19 @@ class ProjectMetaAnalyses(BaseModel): ProjectMetaAnalyses """ # data type: List[MetaAnalysis] - oneof_schema_1_validator: Optional[conlist(MetaAnalysis, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[MetaAnalysis], 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(PROJECTMETAANALYSES_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[MetaAnalysis], List[str]]] = None + one_of_schemas: Set[str] = { "List[MetaAnalysis]", "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 = ProjectMetaAnalyses.construct() + instance = ProjectMetaAnalyses.model_construct() error_messages = [] match = 0 # validate data type: List[MetaAnalysis] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> ProjectMetaAnalyses: + 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) -> ProjectMetaAnalyses: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = ProjectMetaAnalyses.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[MetaAnalysis], 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/neurosynth_compose_sdk/models/project_return.py b/neurosynth_compose_sdk/models/project_return.py index 163f4d5..2e5e1d6 100644 --- a/neurosynth_compose_sdk/models/project_return.py +++ b/neurosynth_compose_sdk/models/project_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,58 +19,79 @@ import json from datetime import datetime -from typing import Any, Dict, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.neurostore_study import NeurostoreStudy from neurosynth_compose_sdk.models.project_meta_analyses import ProjectMetaAnalyses +from typing import Optional, Set +from typing_extensions import Self class ProjectReturn(BaseModel): """ ProjectReturn - """ - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None provenance: Optional[Dict[str, Any]] = None meta_analyses: Optional[ProjectMetaAnalyses] = None name: Optional[StrictStr] = None description: Optional[StrictStr] = None - public: Optional[StrictBool] = Field(None, description="whether the project is public or private") + public: Optional[StrictBool] = Field(default=None, description="whether the project is public or private") neurostore_study: Optional[NeurostoreStudy] = None neurostore_url: Optional[StrictStr] = None draft: Optional[StrictBool] = None - __properties = ["id", "updated_at", "created_at", "user", "username", "provenance", "meta_analyses", "name", "description", "public", "neurostore_study", "neurostore_url", "draft"] + __properties: ClassVar[List[str]] = ["id", "updated_at", "created_at", "user", "username", "provenance", "meta_analyses", "name", "description", "public", "neurostore_study", "neurostore_url", "draft"] + + 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) -> ProjectReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectReturn 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={ - "updated_at", - "created_at", - "username", - "draft", - }, - 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([ + "updated_at", + "created_at", + "username", + "draft", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of meta_analyses if self.meta_analyses: _dict['meta_analyses'] = self.meta_analyses.to_dict() @@ -78,65 +99,66 @@ def to_dict(self): if self.neurostore_study: _dict['neurostore_study'] = self.neurostore_study.to_dict() # 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 provenance (nullable) is None - # and __fields_set__ contains the field - if self.provenance is None and "provenance" in self.__fields_set__: + # and model_fields_set contains the field + if self.provenance is None and "provenance" in self.model_fields_set: _dict['provenance'] = 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 neurostore_url (nullable) is None - # and __fields_set__ contains the field - if self.neurostore_url is None and "neurostore_url" in self.__fields_set__: + # and model_fields_set contains the field + if self.neurostore_url is None and "neurostore_url" in self.model_fields_set: _dict['neurostore_url'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ProjectReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectReturn.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "updated_at": obj.get("updated_at"), "created_at": obj.get("created_at"), "user": obj.get("user"), "username": obj.get("username"), "provenance": obj.get("provenance"), - "meta_analyses": ProjectMetaAnalyses.from_dict(obj.get("meta_analyses")) if obj.get("meta_analyses") is not None else None, + "meta_analyses": ProjectMetaAnalyses.from_dict(obj["meta_analyses"]) if obj.get("meta_analyses") is not None else None, "name": obj.get("name"), "description": obj.get("description"), "public": obj.get("public"), - "neurostore_study": NeurostoreStudy.from_dict(obj.get("neurostore_study")) if obj.get("neurostore_study") is not None else None, + "neurostore_study": NeurostoreStudy.from_dict(obj["neurostore_study"]) if obj.get("neurostore_study") is not None else None, "neurostore_url": obj.get("neurostore_url"), "draft": obj.get("draft") }) return _obj + diff --git a/neurosynth_compose_sdk/models/read_only.py b/neurosynth_compose_sdk/models/read_only.py index 258df6c..f775617 100644 --- a/neurosynth_compose_sdk/models/read_only.py +++ b/neurosynth_compose_sdk/models/read_only.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,74 +19,94 @@ import json from datetime import datetime -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 ReadOnly(BaseModel): """ ReadOnly - """ - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["id", "updated_at", "created_at", "user", "username"] + + 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) -> ReadOnly: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ReadOnly 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={ - "updated_at", - "created_at", - "username", - }, - 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([ + "updated_at", + "created_at", + "username", + ]) + + _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) -> ReadOnly: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ReadOnly from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ReadOnly.parse_obj(obj) + return cls.model_validate(obj) - _obj = ReadOnly.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "updated_at": obj.get("updated_at"), "created_at": obj.get("created_at"), @@ -95,3 +115,4 @@ def from_dict(cls, obj: dict) -> ReadOnly: }) return _obj + diff --git a/neurosynth_compose_sdk/models/result.py b/neurosynth_compose_sdk/models/result.py index e272fb7..3e1328d 100644 --- a/neurosynth_compose_sdk/models/result.py +++ b/neurosynth_compose_sdk/models/result.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,91 +18,107 @@ 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 neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn +from typing import Optional, Set +from typing_extensions import Self class Result(BaseModel): """ describes the output of a meta-analysis - """ - meta_analysis_id: Optional[StrictStr] = Field(None, description="the meta analysis this result was derived from.") - cli_version: Optional[StrictStr] = Field(None, description="version of the command-line-tool that is uploading the results. ") + """ # noqa: E501 + meta_analysis_id: Optional[StrictStr] = Field(default=None, description="the meta analysis this result was derived from.") + cli_version: Optional[StrictStr] = Field(default=None, description="version of the command-line-tool that is uploading the results. ") neurovault_collection: Optional[NeurovaultCollectionReturn] = None - methods_description: Optional[StrictStr] = Field(None, description="the description of the methods applied to create this result.") - diagnostic_table: Optional[StrictStr] = Field(None, description="a text representation of a tsv that marks the contribution of each study to each particular cluster.") - cli_args: Optional[Dict[str, Any]] = Field(None, description="additional parameters that were passed to the commandline tool at runtime. ") + methods_description: Optional[StrictStr] = Field(default=None, description="the description of the methods applied to create this result.") + diagnostic_table: Optional[StrictStr] = Field(default=None, description="a text representation of a tsv that marks the contribution of each study to each particular cluster.") + cli_args: Optional[Dict[str, Any]] = Field(default=None, description="additional parameters that were passed to the commandline tool at runtime. ") status: Optional[StrictStr] = None - __properties = ["meta_analysis_id", "cli_version", "neurovault_collection", "methods_description", "diagnostic_table", "cli_args", "status"] + __properties: ClassVar[List[str]] = ["meta_analysis_id", "cli_version", "neurovault_collection", "methods_description", "diagnostic_table", "cli_args", "status"] + + 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) -> Result: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Result 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 neurovault_collection if self.neurovault_collection: _dict['neurovault_collection'] = self.neurovault_collection.to_dict() # set to None if cli_version (nullable) is None - # and __fields_set__ contains the field - if self.cli_version is None and "cli_version" in self.__fields_set__: + # and model_fields_set contains the field + if self.cli_version is None and "cli_version" in self.model_fields_set: _dict['cli_version'] = None # set to None if methods_description (nullable) is None - # and __fields_set__ contains the field - if self.methods_description is None and "methods_description" in self.__fields_set__: + # and model_fields_set contains the field + if self.methods_description is None and "methods_description" in self.model_fields_set: _dict['methods_description'] = None # set to None if diagnostic_table (nullable) is None - # and __fields_set__ contains the field - if self.diagnostic_table is None and "diagnostic_table" in self.__fields_set__: + # and model_fields_set contains the field + if self.diagnostic_table is None and "diagnostic_table" in self.model_fields_set: _dict['diagnostic_table'] = None # set to None if cli_args (nullable) is None - # and __fields_set__ contains the field - if self.cli_args is None and "cli_args" in self.__fields_set__: + # and model_fields_set contains the field + if self.cli_args is None and "cli_args" in self.model_fields_set: _dict['cli_args'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Result: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Result from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Result.parse_obj(obj) + return cls.model_validate(obj) - _obj = Result.parse_obj({ + _obj = cls.model_validate({ "meta_analysis_id": obj.get("meta_analysis_id"), "cli_version": obj.get("cli_version"), - "neurovault_collection": NeurovaultCollectionReturn.from_dict(obj.get("neurovault_collection")) if obj.get("neurovault_collection") is not None else None, + "neurovault_collection": NeurovaultCollectionReturn.from_dict(obj["neurovault_collection"]) if obj.get("neurovault_collection") is not None else None, "methods_description": obj.get("methods_description"), "diagnostic_table": obj.get("diagnostic_table"), "cli_args": obj.get("cli_args"), @@ -110,3 +126,4 @@ def from_dict(cls, obj: dict) -> Result: }) return _obj + diff --git a/neurosynth_compose_sdk/models/result_init.py b/neurosynth_compose_sdk/models/result_init.py index 465545b..8970fc0 100644 --- a/neurosynth_compose_sdk/models/result_init.py +++ b/neurosynth_compose_sdk/models/result_init.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, 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 ResultInit(BaseModel): """ ResultInit - """ + """ # noqa: E501 meta_analysis_id: Optional[StrictStr] = None studyset_snapshot: Optional[Dict[str, Any]] = None annotation_snapshot: Optional[Dict[str, Any]] = None cli_version: Optional[StrictStr] = None - __properties = ["meta_analysis_id", "studyset_snapshot", "annotation_snapshot", "cli_version"] + __properties: ClassVar[List[str]] = ["meta_analysis_id", "studyset_snapshot", "annotation_snapshot", "cli_version"] + + 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) -> ResultInit: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResultInit 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) -> ResultInit: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResultInit from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResultInit.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResultInit.parse_obj({ + _obj = cls.model_validate({ "meta_analysis_id": obj.get("meta_analysis_id"), "studyset_snapshot": obj.get("studyset_snapshot"), "annotation_snapshot": obj.get("annotation_snapshot"), @@ -75,3 +91,4 @@ def from_dict(cls, obj: dict) -> ResultInit: }) return _obj + diff --git a/neurosynth_compose_sdk/models/result_list.py b/neurosynth_compose_sdk/models/result_list.py index adbbe31..77940c8 100644 --- a/neurosynth_compose_sdk/models/result_list.py +++ b/neurosynth_compose_sdk/models/result_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,60 +18,77 @@ import re # noqa: F401 import json - -from typing import Any, Dict, Optional -from pydantic import BaseModel +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.result_list_results import ResultListResults +from typing import Optional, Set +from typing_extensions import Self class ResultList(BaseModel): """ ResultList - """ + """ # noqa: E501 results: Optional[ResultListResults] = None metadata: Optional[Dict[str, Any]] = 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) -> ResultList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResultList 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 results if self.results: _dict['results'] = self.results.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> ResultList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResultList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResultList.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResultList.parse_obj({ - "results": ResultListResults.from_dict(obj.get("results")) if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": ResultListResults.from_dict(obj["results"]) if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/result_list_results.py b/neurosynth_compose_sdk/models/result_list_results.py index f4ea002..46e7937 100644 --- a/neurosynth_compose_sdk/models/result_list_results.py +++ b/neurosynth_compose_sdk/models/result_list_results.py @@ -3,27 +3,26 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.result_return import ResultReturn -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self RESULTLISTRESULTS_ONE_OF_SCHEMAS = ["List[ResultReturn]", "List[str]"] @@ -32,16 +31,19 @@ class ResultListResults(BaseModel): ResultListResults """ # data type: List[ResultReturn] - oneof_schema_1_validator: Optional[conlist(ResultReturn, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[ResultReturn], 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(RESULTLISTRESULTS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictStr]] = None + actual_instance: Optional[Union[List[ResultReturn], List[str]]] = None + one_of_schemas: Set[str] = { "List[ResultReturn]", "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 = ResultListResults.construct() + instance = ResultListResults.model_construct() error_messages = [] match = 0 # validate data type: List[ResultReturn] @@ -78,13 +80,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> ResultListResults: + 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) -> ResultListResults: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = ResultListResults.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[ResultReturn], 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/neurosynth_compose_sdk/models/result_return.py b/neurosynth_compose_sdk/models/result_return.py index d3af5e5..f3894d3 100644 --- a/neurosynth_compose_sdk/models/result_return.py +++ b/neurosynth_compose_sdk/models/result_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,113 +19,133 @@ 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 neurosynth_compose_sdk.models.neurovault_collection_return import NeurovaultCollectionReturn +from typing import Optional, Set +from typing_extensions import Self class ResultReturn(BaseModel): """ ResultReturn - """ - meta_analysis_id: Optional[StrictStr] = Field(None, description="the meta analysis this result was derived from.") - cli_version: Optional[StrictStr] = Field(None, description="version of the command-line-tool that is uploading the results. ") + """ # noqa: E501 + meta_analysis_id: Optional[StrictStr] = Field(default=None, description="the meta analysis this result was derived from.") + cli_version: Optional[StrictStr] = Field(default=None, description="version of the command-line-tool that is uploading the results. ") neurovault_collection: Optional[NeurovaultCollectionReturn] = None - methods_description: Optional[StrictStr] = Field(None, description="the description of the methods applied to create this result.") - diagnostic_table: Optional[StrictStr] = Field(None, description="a text representation of a tsv that marks the contribution of each study to each particular cluster.") - cli_args: Optional[Dict[str, Any]] = Field(None, description="additional parameters that were passed to the commandline tool at runtime. ") + methods_description: Optional[StrictStr] = Field(default=None, description="the description of the methods applied to create this result.") + diagnostic_table: Optional[StrictStr] = Field(default=None, description="a text representation of a tsv that marks the contribution of each study to each particular cluster.") + cli_args: Optional[Dict[str, Any]] = Field(default=None, description="additional parameters that were passed to the commandline tool at runtime. ") status: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["meta_analysis_id", "cli_version", "neurovault_collection", "methods_description", "diagnostic_table", "cli_args", "status", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["meta_analysis_id", "cli_version", "neurovault_collection", "methods_description", "diagnostic_table", "cli_args", "status", "id", "updated_at", "created_at", "user", "username"] + + 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) -> ResultReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ResultReturn 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={ - "updated_at", - "created_at", - "username", - }, - 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([ + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of neurovault_collection if self.neurovault_collection: _dict['neurovault_collection'] = self.neurovault_collection.to_dict() # set to None if cli_version (nullable) is None - # and __fields_set__ contains the field - if self.cli_version is None and "cli_version" in self.__fields_set__: + # and model_fields_set contains the field + if self.cli_version is None and "cli_version" in self.model_fields_set: _dict['cli_version'] = None # set to None if methods_description (nullable) is None - # and __fields_set__ contains the field - if self.methods_description is None and "methods_description" in self.__fields_set__: + # and model_fields_set contains the field + if self.methods_description is None and "methods_description" in self.model_fields_set: _dict['methods_description'] = None # set to None if diagnostic_table (nullable) is None - # and __fields_set__ contains the field - if self.diagnostic_table is None and "diagnostic_table" in self.__fields_set__: + # and model_fields_set contains the field + if self.diagnostic_table is None and "diagnostic_table" in self.model_fields_set: _dict['diagnostic_table'] = None # set to None if cli_args (nullable) is None - # and __fields_set__ contains the field - if self.cli_args is None and "cli_args" in self.__fields_set__: + # and model_fields_set contains the field + if self.cli_args is None and "cli_args" in self.model_fields_set: _dict['cli_args'] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict['status'] = 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) -> ResultReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ResultReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ResultReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = ResultReturn.parse_obj({ + _obj = cls.model_validate({ "meta_analysis_id": obj.get("meta_analysis_id"), "cli_version": obj.get("cli_version"), - "neurovault_collection": NeurovaultCollectionReturn.from_dict(obj.get("neurovault_collection")) if obj.get("neurovault_collection") is not None else None, + "neurovault_collection": NeurovaultCollectionReturn.from_dict(obj["neurovault_collection"]) if obj.get("neurovault_collection") is not None else None, "methods_description": obj.get("methods_description"), "diagnostic_table": obj.get("diagnostic_table"), "cli_args": obj.get("cli_args"), @@ -138,3 +158,4 @@ def from_dict(cls, obj: dict) -> ResultReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/specification.py b/neurosynth_compose_sdk/models/specification.py index 0026bcc..cad9016 100644 --- a/neurosynth_compose_sdk/models/specification.py +++ b/neurosynth_compose_sdk/models/specification.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,52 +18,68 @@ 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 neurosynth_compose_sdk.models.corrector import Corrector from neurosynth_compose_sdk.models.estimator import Estimator from neurosynth_compose_sdk.models.specification_conditions import SpecificationConditions +from typing import Optional, Set +from typing_extensions import Self class Specification(BaseModel): """ a machine readable specification of how to run a meta-analysis (currently specifically tailored to NiMARE). - """ - type: Optional[StrictStr] = Field(None, description="the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future.") + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future.") estimator: Optional[Estimator] = None - mask: Optional[StrictStr] = Field(None, description="a string representing a binary nifti file to select which voxels a user wants to include in the analysis.") + mask: Optional[StrictStr] = Field(default=None, description="a string representing a binary nifti file to select which voxels a user wants to include in the analysis.") conditions: Optional[SpecificationConditions] = None - weights: Optional[conlist(Union[StrictFloat, StrictInt])] = None - transformer: Optional[StrictStr] = Field(None, description="A transformation applied to column(s) (e.g., binarize based on a threshold). This is likely to become deprecated.") + weights: Optional[List[Union[StrictFloat, StrictInt]]] = None + transformer: Optional[StrictStr] = Field(default=None, description="A transformation applied to column(s) (e.g., binarize based on a threshold). This is likely to become deprecated.") corrector: Optional[Corrector] = None - filter: Optional[StrictStr] = Field(None, description="a column from annotations selecting which analyses to include in the meta-analysis") + filter: Optional[StrictStr] = Field(default=None, description="a column from annotations selecting which analyses to include in the meta-analysis") database_studyset: Optional[StrictStr] = None - __properties = ["type", "estimator", "mask", "conditions", "weights", "transformer", "corrector", "filter", "database_studyset"] + __properties: ClassVar[List[str]] = ["type", "estimator", "mask", "conditions", "weights", "transformer", "corrector", "filter", "database_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) -> Specification: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Specification 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 estimator if self.estimator: _dict['estimator'] = self.estimator.to_dict() @@ -74,56 +90,57 @@ def to_dict(self): if self.corrector: _dict['corrector'] = self.corrector.to_dict() # set to None if mask (nullable) is None - # and __fields_set__ contains the field - if self.mask is None and "mask" in self.__fields_set__: + # and model_fields_set contains the field + if self.mask is None and "mask" in self.model_fields_set: _dict['mask'] = None # set to None if weights (nullable) is None - # and __fields_set__ contains the field - if self.weights is None and "weights" in self.__fields_set__: + # and model_fields_set contains the field + if self.weights is None and "weights" in self.model_fields_set: _dict['weights'] = None # set to None if transformer (nullable) is None - # and __fields_set__ contains the field - if self.transformer is None and "transformer" in self.__fields_set__: + # and model_fields_set contains the field + if self.transformer is None and "transformer" in self.model_fields_set: _dict['transformer'] = None # set to None if corrector (nullable) is None - # and __fields_set__ contains the field - if self.corrector is None and "corrector" in self.__fields_set__: + # and model_fields_set contains the field + if self.corrector is None and "corrector" in self.model_fields_set: _dict['corrector'] = None # set to None if filter (nullable) is None - # and __fields_set__ contains the field - if self.filter is None and "filter" in self.__fields_set__: + # and model_fields_set contains the field + if self.filter is None and "filter" in self.model_fields_set: _dict['filter'] = None # set to None if database_studyset (nullable) is None - # and __fields_set__ contains the field - if self.database_studyset is None and "database_studyset" in self.__fields_set__: + # and model_fields_set contains the field + if self.database_studyset is None and "database_studyset" in self.model_fields_set: _dict['database_studyset'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Specification: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Specification from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Specification.parse_obj(obj) + return cls.model_validate(obj) - _obj = Specification.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), - "estimator": Estimator.from_dict(obj.get("estimator")) if obj.get("estimator") is not None else None, + "estimator": Estimator.from_dict(obj["estimator"]) if obj.get("estimator") is not None else None, "mask": obj.get("mask"), - "conditions": SpecificationConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None, + "conditions": SpecificationConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, "weights": obj.get("weights"), "transformer": obj.get("transformer"), - "corrector": Corrector.from_dict(obj.get("corrector")) if obj.get("corrector") is not None else None, + "corrector": Corrector.from_dict(obj["corrector"]) if obj.get("corrector") is not None else None, "filter": obj.get("filter"), "database_studyset": obj.get("database_studyset") }) return _obj + diff --git a/neurosynth_compose_sdk/models/specification_conditions.py b/neurosynth_compose_sdk/models/specification_conditions.py index afc8187..d2a3810 100644 --- a/neurosynth_compose_sdk/models/specification_conditions.py +++ b/neurosynth_compose_sdk/models/specification_conditions.py @@ -3,26 +3,25 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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, StrictBool, StrictStr, ValidationError, field_validator from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, ValidationError, conlist, validator -from typing import Any, List +from typing_extensions import Annotated from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self SPECIFICATIONCONDITIONS_ONE_OF_SCHEMAS = ["List[bool]", "List[str]"] @@ -31,16 +30,19 @@ class SpecificationConditions(BaseModel): selection of categories in the filter column to differentiate groups, or \"neurosynth\", \"neuroquery\", or \"neurostore\" to compare to a database reference group """ # data type: List[str] - oneof_schema_1_validator: Optional[conlist(StrictStr, min_items=1)] = None + oneof_schema_1_validator: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = None # data type: List[bool] - oneof_schema_2_validator: Optional[conlist(StrictBool)] = None - actual_instance: Any - one_of_schemas: List[str] = Field(SPECIFICATIONCONDITIONS_ONE_OF_SCHEMAS, const=True) + oneof_schema_2_validator: Optional[List[StrictBool]] = None + actual_instance: Optional[Union[List[bool], List[str]]] = None + one_of_schemas: Set[str] = { "List[bool]", "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`") @@ -50,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 = SpecificationConditions.construct() + instance = SpecificationConditions.model_construct() error_messages = [] match = 0 # validate data type: List[str] @@ -77,13 +79,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> SpecificationConditions: + 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) -> SpecificationConditions: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = SpecificationConditions.construct() + instance = cls.model_construct() error_messages = [] match = 0 @@ -120,19 +122,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[bool], 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 @@ -140,5 +140,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/neurosynth_compose_sdk/models/specification_list.py b/neurosynth_compose_sdk/models/specification_list.py index 360a265..2025507 100644 --- a/neurosynth_compose_sdk/models/specification_list.py +++ b/neurosynth_compose_sdk/models/specification_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.specification_return import SpecificationReturn +from typing import Optional, Set +from typing_extensions import Self class SpecificationList(BaseModel): """ The representation of a list of specifications. - """ - results: Optional[conlist(SpecificationReturn)] = None + """ # noqa: E501 + results: Optional[List[SpecificationReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> SpecificationList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SpecificationList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> SpecificationList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SpecificationList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SpecificationList.parse_obj(obj) + return cls.model_validate(obj) - _obj = SpecificationList.parse_obj({ - "results": [SpecificationReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [SpecificationReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/specification_post_body.py b/neurosynth_compose_sdk/models/specification_post_body.py index 9aed2f8..a804810 100644 --- a/neurosynth_compose_sdk/models/specification_post_body.py +++ b/neurosynth_compose_sdk/models/specification_post_body.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,52 +18,68 @@ 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 neurosynth_compose_sdk.models.corrector import Corrector from neurosynth_compose_sdk.models.estimator import Estimator from neurosynth_compose_sdk.models.specification_conditions import SpecificationConditions +from typing import Optional, Set +from typing_extensions import Self class SpecificationPostBody(BaseModel): """ SpecificationPostBody - """ - type: Optional[StrictStr] = Field(None, description="the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future.") + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future.") estimator: Optional[Estimator] = None - mask: Optional[StrictStr] = Field(None, description="a string representing a binary nifti file to select which voxels a user wants to include in the analysis.") + mask: Optional[StrictStr] = Field(default=None, description="a string representing a binary nifti file to select which voxels a user wants to include in the analysis.") conditions: Optional[SpecificationConditions] = None - weights: Optional[conlist(Union[StrictFloat, StrictInt])] = None - transformer: Optional[StrictStr] = Field(None, description="A transformation applied to column(s) (e.g., binarize based on a threshold). This is likely to become deprecated.") + weights: Optional[List[Union[StrictFloat, StrictInt]]] = None + transformer: Optional[StrictStr] = Field(default=None, description="A transformation applied to column(s) (e.g., binarize based on a threshold). This is likely to become deprecated.") corrector: Optional[Corrector] = None - filter: Optional[StrictStr] = Field(None, description="a column from annotations selecting which analyses to include in the meta-analysis") + filter: Optional[StrictStr] = Field(default=None, description="a column from annotations selecting which analyses to include in the meta-analysis") database_studyset: Optional[StrictStr] = None - __properties = ["type", "estimator", "mask", "conditions", "weights", "transformer", "corrector", "filter", "database_studyset"] + __properties: ClassVar[List[str]] = ["type", "estimator", "mask", "conditions", "weights", "transformer", "corrector", "filter", "database_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) -> SpecificationPostBody: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SpecificationPostBody 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 estimator if self.estimator: _dict['estimator'] = self.estimator.to_dict() @@ -74,56 +90,57 @@ def to_dict(self): if self.corrector: _dict['corrector'] = self.corrector.to_dict() # set to None if mask (nullable) is None - # and __fields_set__ contains the field - if self.mask is None and "mask" in self.__fields_set__: + # and model_fields_set contains the field + if self.mask is None and "mask" in self.model_fields_set: _dict['mask'] = None # set to None if weights (nullable) is None - # and __fields_set__ contains the field - if self.weights is None and "weights" in self.__fields_set__: + # and model_fields_set contains the field + if self.weights is None and "weights" in self.model_fields_set: _dict['weights'] = None # set to None if transformer (nullable) is None - # and __fields_set__ contains the field - if self.transformer is None and "transformer" in self.__fields_set__: + # and model_fields_set contains the field + if self.transformer is None and "transformer" in self.model_fields_set: _dict['transformer'] = None # set to None if corrector (nullable) is None - # and __fields_set__ contains the field - if self.corrector is None and "corrector" in self.__fields_set__: + # and model_fields_set contains the field + if self.corrector is None and "corrector" in self.model_fields_set: _dict['corrector'] = None # set to None if filter (nullable) is None - # and __fields_set__ contains the field - if self.filter is None and "filter" in self.__fields_set__: + # and model_fields_set contains the field + if self.filter is None and "filter" in self.model_fields_set: _dict['filter'] = None # set to None if database_studyset (nullable) is None - # and __fields_set__ contains the field - if self.database_studyset is None and "database_studyset" in self.__fields_set__: + # and model_fields_set contains the field + if self.database_studyset is None and "database_studyset" in self.model_fields_set: _dict['database_studyset'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> SpecificationPostBody: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SpecificationPostBody from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SpecificationPostBody.parse_obj(obj) + return cls.model_validate(obj) - _obj = SpecificationPostBody.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), - "estimator": Estimator.from_dict(obj.get("estimator")) if obj.get("estimator") is not None else None, + "estimator": Estimator.from_dict(obj["estimator"]) if obj.get("estimator") is not None else None, "mask": obj.get("mask"), - "conditions": SpecificationConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None, + "conditions": SpecificationConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, "weights": obj.get("weights"), "transformer": obj.get("transformer"), - "corrector": Corrector.from_dict(obj.get("corrector")) if obj.get("corrector") is not None else None, + "corrector": Corrector.from_dict(obj["corrector"]) if obj.get("corrector") is not None else None, "filter": obj.get("filter"), "database_studyset": obj.get("database_studyset") }) return _obj + diff --git a/neurosynth_compose_sdk/models/specification_return.py b/neurosynth_compose_sdk/models/specification_return.py index e1e47c7..2d88043 100644 --- a/neurosynth_compose_sdk/models/specification_return.py +++ b/neurosynth_compose_sdk/models/specification_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,59 +19,79 @@ import json from datetime import datetime -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 neurosynth_compose_sdk.models.corrector import Corrector from neurosynth_compose_sdk.models.estimator import Estimator from neurosynth_compose_sdk.models.specification_conditions import SpecificationConditions +from typing import Optional, Set +from typing_extensions import Self class SpecificationReturn(BaseModel): """ The view of the specification through an endpoint. - """ - type: Optional[StrictStr] = Field(None, description="the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future.") + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="the type of meta-analysis being run, typically either cbma or ibma, but others may become available in the future.") estimator: Optional[Estimator] = None - mask: Optional[StrictStr] = Field(None, description="a string representing a binary nifti file to select which voxels a user wants to include in the analysis.") + mask: Optional[StrictStr] = Field(default=None, description="a string representing a binary nifti file to select which voxels a user wants to include in the analysis.") conditions: Optional[SpecificationConditions] = None - weights: Optional[conlist(Union[StrictFloat, StrictInt])] = None - transformer: Optional[StrictStr] = Field(None, description="A transformation applied to column(s) (e.g., binarize based on a threshold). This is likely to become deprecated.") + weights: Optional[List[Union[StrictFloat, StrictInt]]] = None + transformer: Optional[StrictStr] = Field(default=None, description="A transformation applied to column(s) (e.g., binarize based on a threshold). This is likely to become deprecated.") corrector: Optional[Corrector] = None - filter: Optional[StrictStr] = Field(None, description="a column from annotations selecting which analyses to include in the meta-analysis") + filter: Optional[StrictStr] = Field(default=None, description="a column from annotations selecting which analyses to include in the meta-analysis") database_studyset: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["type", "estimator", "mask", "conditions", "weights", "transformer", "corrector", "filter", "database_studyset", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["type", "estimator", "mask", "conditions", "weights", "transformer", "corrector", "filter", "database_studyset", "id", "updated_at", "created_at", "user", "username"] + + 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) -> SpecificationReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SpecificationReturn 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={ - "updated_at", - "created_at", - "username", - }, - 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([ + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of estimator if self.estimator: _dict['estimator'] = self.estimator.to_dict() @@ -82,69 +102,69 @@ def to_dict(self): if self.corrector: _dict['corrector'] = self.corrector.to_dict() # set to None if mask (nullable) is None - # and __fields_set__ contains the field - if self.mask is None and "mask" in self.__fields_set__: + # and model_fields_set contains the field + if self.mask is None and "mask" in self.model_fields_set: _dict['mask'] = None # set to None if weights (nullable) is None - # and __fields_set__ contains the field - if self.weights is None and "weights" in self.__fields_set__: + # and model_fields_set contains the field + if self.weights is None and "weights" in self.model_fields_set: _dict['weights'] = None # set to None if transformer (nullable) is None - # and __fields_set__ contains the field - if self.transformer is None and "transformer" in self.__fields_set__: + # and model_fields_set contains the field + if self.transformer is None and "transformer" in self.model_fields_set: _dict['transformer'] = None # set to None if corrector (nullable) is None - # and __fields_set__ contains the field - if self.corrector is None and "corrector" in self.__fields_set__: + # and model_fields_set contains the field + if self.corrector is None and "corrector" in self.model_fields_set: _dict['corrector'] = None # set to None if filter (nullable) is None - # and __fields_set__ contains the field - if self.filter is None and "filter" in self.__fields_set__: + # and model_fields_set contains the field + if self.filter is None and "filter" in self.model_fields_set: _dict['filter'] = None # set to None if database_studyset (nullable) is None - # and __fields_set__ contains the field - if self.database_studyset is None and "database_studyset" in self.__fields_set__: + # and model_fields_set contains the field + if self.database_studyset is None and "database_studyset" in self.model_fields_set: _dict['database_studyset'] = 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) -> SpecificationReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SpecificationReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SpecificationReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = SpecificationReturn.parse_obj({ + _obj = cls.model_validate({ "type": obj.get("type"), - "estimator": Estimator.from_dict(obj.get("estimator")) if obj.get("estimator") is not None else None, + "estimator": Estimator.from_dict(obj["estimator"]) if obj.get("estimator") is not None else None, "mask": obj.get("mask"), - "conditions": SpecificationConditions.from_dict(obj.get("conditions")) if obj.get("conditions") is not None else None, + "conditions": SpecificationConditions.from_dict(obj["conditions"]) if obj.get("conditions") is not None else None, "weights": obj.get("weights"), "transformer": obj.get("transformer"), - "corrector": Corrector.from_dict(obj.get("corrector")) if obj.get("corrector") is not None else None, + "corrector": Corrector.from_dict(obj["corrector"]) if obj.get("corrector") is not None else None, "filter": obj.get("filter"), "database_studyset": obj.get("database_studyset"), "id": obj.get("id"), @@ -155,3 +175,4 @@ def from_dict(cls, obj: dict) -> SpecificationReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset.py b/neurosynth_compose_sdk/models/studyset.py index da3ed6a..b199aa7 100644 --- a/neurosynth_compose_sdk/models/studyset.py +++ b/neurosynth_compose_sdk/models/studyset.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,67 +18,84 @@ 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 Studyset(BaseModel): """ Studyset - """ - neurostore_id: Optional[StrictStr] = Field(None, description="The id of the studyset on neurostore.") - snapshot: Optional[Dict[str, Any]] = Field(None, description="The snapshot of the studyset pending a successful run of the meta-analysis.") + """ # noqa: E501 + neurostore_id: Optional[StrictStr] = Field(default=None, description="The id of the studyset on neurostore.") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="The snapshot of the studyset pending a successful run of the meta-analysis.") neurostore_url: Optional[StrictStr] = None - version: Optional[StrictStr] = Field(None, description="A string representing a labeled version of this particular studyset.") - __properties = ["neurostore_id", "snapshot", "neurostore_url", "version"] + version: Optional[StrictStr] = Field(default=None, description="A string representing a labeled version of this particular studyset.") + __properties: ClassVar[List[str]] = ["neurostore_id", "snapshot", "neurostore_url", "version"] + + 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) -> Studyset: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Studyset 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={ - "neurostore_url", - }, - 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([ + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = None # set to None if version (nullable) is None - # and __fields_set__ contains the field - if self.version is None and "version" in self.__fields_set__: + # and model_fields_set contains the field + if self.version is None and "version" in self.model_fields_set: _dict['version'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Studyset: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Studyset from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Studyset.parse_obj(obj) + return cls.model_validate(obj) - _obj = Studyset.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), "neurostore_url": obj.get("neurostore_url"), @@ -86,3 +103,4 @@ def from_dict(cls, obj: dict) -> Studyset: }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset_list.py b/neurosynth_compose_sdk/models/studyset_list.py index 6bc9c57..28c0f12 100644 --- a/neurosynth_compose_sdk/models/studyset_list.py +++ b/neurosynth_compose_sdk/models/studyset_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_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[Dict[str, Any]] = 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 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, + _obj = cls.model_validate({ + "results": [StudysetReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset_post_body.py b/neurosynth_compose_sdk/models/studyset_post_body.py index 7a2e6b9..70564cc 100644 --- a/neurosynth_compose_sdk/models/studyset_post_body.py +++ b/neurosynth_compose_sdk/models/studyset_post_body.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,67 +18,84 @@ 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 StudysetPostBody(BaseModel): """ StudysetPostBody - """ - neurostore_id: StrictStr = Field(..., description="The id of the studyset on neurostore.") - snapshot: Optional[Dict[str, Any]] = Field(None, description="The snapshot of the studyset pending a successful run of the meta-analysis.") + """ # noqa: E501 + neurostore_id: StrictStr = Field(description="The id of the studyset on neurostore.") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="The snapshot of the studyset pending a successful run of the meta-analysis.") neurostore_url: Optional[StrictStr] = None - version: Optional[StrictStr] = Field(None, description="A string representing a labeled version of this particular studyset.") - __properties = ["neurostore_id", "snapshot", "neurostore_url", "version"] + version: Optional[StrictStr] = Field(default=None, description="A string representing a labeled version of this particular studyset.") + __properties: ClassVar[List[str]] = ["neurostore_id", "snapshot", "neurostore_url", "version"] + + 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) -> StudysetPostBody: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetPostBody 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={ - "neurostore_url", - }, - 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([ + "neurostore_url", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = None # set to None if version (nullable) is None - # and __fields_set__ contains the field - if self.version is None and "version" in self.__fields_set__: + # and model_fields_set contains the field + if self.version is None and "version" in self.model_fields_set: _dict['version'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetPostBody: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetPostBody from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetPostBody.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetPostBody.parse_obj({ + _obj = cls.model_validate({ "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), "neurostore_url": obj.get("neurostore_url"), @@ -86,3 +103,4 @@ def from_dict(cls, obj: dict) -> StudysetPostBody: }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset_reference.py b/neurosynth_compose_sdk/models/studyset_reference.py index 3186047..67cc7c5 100644 --- a/neurosynth_compose_sdk/models/studyset_reference.py +++ b/neurosynth_compose_sdk/models/studyset_reference.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,79 @@ 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 neurosynth_compose_sdk.models.studyset_reference_snapshots_inner import StudysetReferenceSnapshotsInner +from typing import Optional, Set +from typing_extensions import Self class StudysetReference(BaseModel): """ StudysetReference - """ - snapshots: Optional[conlist(StudysetReferenceSnapshotsInner)] = None - __properties = ["snapshots"] + """ # noqa: E501 + snapshots: Optional[List[StudysetReferenceSnapshotsInner]] = None + __properties: ClassVar[List[str]] = ["snapshots"] + + 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) -> StudysetReference: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetReference 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 snapshots (list) _items = [] if self.snapshots: - for _item in self.snapshots: - if _item: - _items.append(_item.to_dict()) + for _item_snapshots in self.snapshots: + if _item_snapshots: + _items.append(_item_snapshots.to_dict()) _dict['snapshots'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetReference: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetReference from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetReference.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetReference.parse_obj({ - "snapshots": [StudysetReferenceSnapshotsInner.from_dict(_item) for _item in obj.get("snapshots")] if obj.get("snapshots") is not None else None + _obj = cls.model_validate({ + "snapshots": [StudysetReferenceSnapshotsInner.from_dict(_item) for _item in obj["snapshots"]] if obj.get("snapshots") is not None else None }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset_reference_list.py b/neurosynth_compose_sdk/models/studyset_reference_list.py index 01497c5..848c432 100644 --- a/neurosynth_compose_sdk/models/studyset_reference_list.py +++ b/neurosynth_compose_sdk/models/studyset_reference_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.studyset_reference_return import StudysetReferenceReturn +from typing import Optional, Set +from typing_extensions import Self class StudysetReferenceList(BaseModel): """ StudysetReferenceList - """ - results: Optional[conlist(StudysetReferenceReturn)] = None + """ # noqa: E501 + results: Optional[List[StudysetReferenceReturn]] = None metadata: Optional[Dict[str, Any]] = 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) -> StudysetReferenceList: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetReferenceList 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 return _dict @classmethod - def from_dict(cls, obj: dict) -> StudysetReferenceList: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetReferenceList from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetReferenceList.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetReferenceList.parse_obj({ - "results": [StudysetReferenceReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [StudysetReferenceReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset_reference_return.py b/neurosynth_compose_sdk/models/studyset_reference_return.py index 9f13d27..19a1cfc 100644 --- a/neurosynth_compose_sdk/models/studyset_reference_return.py +++ b/neurosynth_compose_sdk/models/studyset_reference_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,84 +19,104 @@ import json from datetime import datetime -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.studyset_reference_snapshots_inner import StudysetReferenceSnapshotsInner +from typing import Optional, Set +from typing_extensions import Self class StudysetReferenceReturn(BaseModel): """ StudysetReferenceReturn - """ - snapshots: Optional[conlist(StudysetReferenceSnapshotsInner)] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + """ # noqa: E501 + snapshots: Optional[List[StudysetReferenceSnapshotsInner]] = None + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["snapshots", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["snapshots", "id", "updated_at", "created_at", "user", "username"] + + 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) -> StudysetReferenceReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StudysetReferenceReturn 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={ - "updated_at", - "created_at", - "username", - }, - 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([ + "updated_at", + "created_at", + "username", + ]) + + _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 snapshots (list) _items = [] if self.snapshots: - for _item in self.snapshots: - if _item: - _items.append(_item.to_dict()) + for _item_snapshots in self.snapshots: + if _item_snapshots: + _items.append(_item_snapshots.to_dict()) _dict['snapshots'] = _items # 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) -> StudysetReferenceReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StudysetReferenceReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StudysetReferenceReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = StudysetReferenceReturn.parse_obj({ - "snapshots": [StudysetReferenceSnapshotsInner.from_dict(_item) for _item in obj.get("snapshots")] if obj.get("snapshots") is not None else None, + _obj = cls.model_validate({ + "snapshots": [StudysetReferenceSnapshotsInner.from_dict(_item) for _item in obj["snapshots"]] if obj.get("snapshots") is not None else None, "id": obj.get("id"), "updated_at": obj.get("updated_at"), "created_at": obj.get("created_at"), @@ -105,3 +125,4 @@ def from_dict(cls, obj: dict) -> StudysetReferenceReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/studyset_reference_snapshots_inner.py b/neurosynth_compose_sdk/models/studyset_reference_snapshots_inner.py index 400f548..85e0858 100644 --- a/neurosynth_compose_sdk/models/studyset_reference_snapshots_inner.py +++ b/neurosynth_compose_sdk/models/studyset_reference_snapshots_inner.py @@ -3,27 +3,25 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.models.studyset import Studyset -from typing import Any, List from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self STUDYSETREFERENCESNAPSHOTSINNER_ONE_OF_SCHEMAS = ["Studyset", "str"] @@ -35,13 +33,16 @@ class StudysetReferenceSnapshotsInner(BaseModel): oneof_schema_1_validator: Optional[StrictStr] = None # data type: Studyset oneof_schema_2_validator: Optional[Studyset] = None - actual_instance: Any - one_of_schemas: List[str] = Field(STUDYSETREFERENCESNAPSHOTSINNER_ONE_OF_SCHEMAS, const=True) + actual_instance: Optional[Union[Studyset, str]] = None + one_of_schemas: Set[str] = { "Studyset", "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 +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 = StudysetReferenceSnapshotsInner.construct() + instance = StudysetReferenceSnapshotsInner.model_construct() error_messages = [] match = 0 # validate data type: str @@ -77,13 +78,13 @@ def actual_instance_must_validate_oneof(cls, v): return v @classmethod - def from_dict(cls, obj: dict) -> StudysetReferenceSnapshotsInner: + 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) -> StudysetReferenceSnapshotsInner: + def from_json(cls, json_str: str) -> Self: """Returns the object represented by the json string""" - instance = StudysetReferenceSnapshotsInner.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], Studyset, 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 @@ -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/neurosynth_compose_sdk/models/studyset_return.py b/neurosynth_compose_sdk/models/studyset_return.py index 11972ba..6ed8e79 100644 --- a/neurosynth_compose_sdk/models/studyset_return.py +++ b/neurosynth_compose_sdk/models/studyset_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,89 +19,110 @@ 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 StudysetReturn(BaseModel): """ StudysetReturn - """ - neurostore_id: Optional[StrictStr] = Field(None, description="The id of the studyset on neurostore.") - snapshot: Optional[Dict[str, Any]] = Field(None, description="The snapshot of the studyset pending a successful run of the meta-analysis.") + """ # noqa: E501 + neurostore_id: Optional[StrictStr] = Field(default=None, description="The id of the studyset on neurostore.") + snapshot: Optional[Dict[str, Any]] = Field(default=None, description="The snapshot of the studyset pending a successful run of the meta-analysis.") neurostore_url: Optional[StrictStr] = None - version: Optional[StrictStr] = Field(None, description="A string representing a labeled version of this particular studyset.") - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + version: Optional[StrictStr] = Field(default=None, description="A string representing a labeled version of this particular studyset.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["neurostore_id", "snapshot", "neurostore_url", "version", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["neurostore_id", "snapshot", "neurostore_url", "version", "id", "updated_at", "created_at", "user", "username"] + + 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) -> 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={ - "neurostore_url", - "updated_at", - "created_at", - "username", - }, - 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([ + "neurostore_url", + "updated_at", + "created_at", + "username", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if snapshot (nullable) is None - # and __fields_set__ contains the field - if self.snapshot is None and "snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.snapshot is None and "snapshot" in self.model_fields_set: _dict['snapshot'] = None # set to None if version (nullable) is None - # and __fields_set__ contains the field - if self.version is None and "version" in self.__fields_set__: + # and model_fields_set contains the field + if self.version is None and "version" in self.model_fields_set: _dict['version'] = 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) -> 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({ "neurostore_id": obj.get("neurostore_id"), "snapshot": obj.get("snapshot"), "neurostore_url": obj.get("neurostore_url"), @@ -114,3 +135,4 @@ def from_dict(cls, obj: dict) -> StudysetReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/models/user.py b/neurosynth_compose_sdk/models/user.py index 9f96841..af5340d 100644 --- a/neurosynth_compose_sdk/models/user.py +++ b/neurosynth_compose_sdk/models/user.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 User(BaseModel): """ attributes of the user object - """ + """ # noqa: E501 external_id: Optional[StrictStr] = None - __properties = ["external_id"] + __properties: ClassVar[List[str]] = ["external_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) -> 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({ "external_id": obj.get("external_id") }) return _obj + diff --git a/neurosynth_compose_sdk/models/user_list.py b/neurosynth_compose_sdk/models/user_list.py index 24e10da..6b0f709 100644 --- a/neurosynth_compose_sdk/models/user_list.py +++ b/neurosynth_compose_sdk/models/user_list.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 Any, Dict, List, Optional -from pydantic import BaseModel, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from neurosynth_compose_sdk.models.user_return import UserReturn +from typing import Optional, Set +from typing_extensions import Self class UserList(BaseModel): """ UserList - """ - results: Optional[conlist(UserReturn)] = None + """ # noqa: E501 + results: Optional[List[UserReturn]] = None metadata: Optional[Dict[str, Any]] = 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 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": [UserReturn.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None, + _obj = cls.model_validate({ + "results": [UserReturn.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None, "metadata": obj.get("metadata") }) return _obj + diff --git a/neurosynth_compose_sdk/models/user_return.py b/neurosynth_compose_sdk/models/user_return.py index dc4aa79..08245b5 100644 --- a/neurosynth_compose_sdk/models/user_return.py +++ b/neurosynth_compose_sdk/models/user_return.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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,95 @@ import json from datetime import datetime -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 UserReturn(BaseModel): """ UserReturn - """ + """ # noqa: E501 external_id: Optional[StrictStr] = None - id: Optional[StrictStr] = Field(None, description="the identifier for the resource.") - updated_at: Optional[datetime] = Field(None, description="when the resource was last modified.") - created_at: Optional[datetime] = Field(None, description="When the resource was created.") - user: Optional[StrictStr] = Field(None, description="Who owns the resource.") + id: Optional[StrictStr] = Field(default=None, description="the identifier for the resource.") + updated_at: Optional[datetime] = Field(default=None, description="when the resource was last modified.") + created_at: Optional[datetime] = Field(default=None, description="When the resource was created.") + user: Optional[StrictStr] = Field(default=None, description="Who owns the resource.") username: Optional[StrictStr] = None - __properties = ["external_id", "id", "updated_at", "created_at", "user", "username"] + __properties: ClassVar[List[str]] = ["external_id", "id", "updated_at", "created_at", "user", "username"] + + 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) -> UserReturn: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserReturn 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={ - "updated_at", - "created_at", - "username", - }, - 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([ + "updated_at", + "created_at", + "username", + ]) + + _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) -> UserReturn: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserReturn from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserReturn.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserReturn.parse_obj({ + _obj = cls.model_validate({ "external_id": obj.get("external_id"), "id": obj.get("id"), "updated_at": obj.get("updated_at"), @@ -97,3 +117,4 @@ def from_dict(cls, obj: dict) -> UserReturn: }) return _obj + diff --git a/neurosynth_compose_sdk/py.typed b/neurosynth_compose_sdk/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/neurosynth_compose_sdk/rest.py b/neurosynth_compose_sdk/rest.py index 044d0ce..1b3a283 100644 --- a/neurosynth_compose_sdk/rest.py +++ b/neurosynth_compose_sdk/rest.py @@ -3,55 +3,67 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 neurosynth_compose_sdk.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from neurosynth_compose_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 e57d9ac..0fde860 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", "Analysis Specification for Meta-analysis"] +include = ["neurosynth_compose_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 = [ + "neurosynth_compose_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 = [ + "neurosynth_compose_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 8a641cd..70654b7 100644 --- a/setup.py +++ b/setup.py @@ -3,14 +3,14 @@ """ Analysis Specification for Meta-analysis - api to create a meta-analysis specification # noqa: E501 + api to create a meta-analysis specification 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 = "neurosynth-compose-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="""\ - api to create a meta-analysis specification # noqa: E501 - """ -) + api to create a meta-analysis specification + """, # noqa: E501 + package_data={"neurosynth_compose_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