diff --git a/README.md b/README.md index edd0bb5..89fd4f9 100644 --- a/README.md +++ b/README.md @@ -101,9 +101,11 @@ Class | Method | HTTP request | Description *AnalysesApi* | [**annotation_analyses_get**](docs/AnalysesApi.md#annotation_analyses_get) | **GET** /annotation-analyses/ | Get annotation analyses *AnalysesApi* | [**annotation_analyses_id_get**](docs/AnalysesApi.md#annotation_analyses_id_get) | **GET** /annotation-analyses/{id} | Your GET endpoint *AnalysesApi* | [**annotation_analyses_id_put**](docs/AnalysesApi.md#annotation_analyses_id_put) | **PUT** /annotation-analyses/{id} | Your PUT endpoint +*AnalysesApi* | [**annotation_analyses_post**](docs/AnalysesApi.md#annotation_analyses_post) | **POST** /annotation-analyses/ | Your POST endpoint *AnnotationsApi* | [**annotation_analyses_get**](docs/AnnotationsApi.md#annotation_analyses_get) | **GET** /annotation-analyses/ | Get annotation analyses *AnnotationsApi* | [**annotation_analyses_id_get**](docs/AnnotationsApi.md#annotation_analyses_id_get) | **GET** /annotation-analyses/{id} | Your GET endpoint *AnnotationsApi* | [**annotation_analyses_id_put**](docs/AnnotationsApi.md#annotation_analyses_id_put) | **PUT** /annotation-analyses/{id} | Your PUT endpoint +*AnnotationsApi* | [**annotation_analyses_post**](docs/AnnotationsApi.md#annotation_analyses_post) | **POST** /annotation-analyses/ | Your POST endpoint *AnnotationsApi* | [**annotations_get**](docs/AnnotationsApi.md#annotations_get) | **GET** /annotations/ | Your GET endpoint *AnnotationsApi* | [**annotations_id_delete**](docs/AnnotationsApi.md#annotations_id_delete) | **DELETE** /annotations/{id} | DELETE an annotation *AnnotationsApi* | [**annotations_id_get**](docs/AnnotationsApi.md#annotations_id_get) | **GET** /annotations/{id} | Your GET endpoint @@ -132,6 +134,7 @@ Class | Method | HTTP request | Description *StoreApi* | [**annotation_analyses_get**](docs/StoreApi.md#annotation_analyses_get) | **GET** /annotation-analyses/ | Get annotation analyses *StoreApi* | [**annotation_analyses_id_get**](docs/StoreApi.md#annotation_analyses_id_get) | **GET** /annotation-analyses/{id} | Your GET endpoint *StoreApi* | [**annotation_analyses_id_put**](docs/StoreApi.md#annotation_analyses_id_put) | **PUT** /annotation-analyses/{id} | Your PUT endpoint +*StoreApi* | [**annotation_analyses_post**](docs/StoreApi.md#annotation_analyses_post) | **POST** /annotation-analyses/ | Your POST endpoint *StoreApi* | [**annotations_get**](docs/StoreApi.md#annotations_get) | **GET** /annotations/ | Your GET endpoint *StoreApi* | [**annotations_id_delete**](docs/StoreApi.md#annotations_id_delete) | **DELETE** /annotations/{id} | DELETE an annotation *StoreApi* | [**annotations_id_get**](docs/StoreApi.md#annotations_id_get) | **GET** /annotations/{id} | Your GET endpoint diff --git a/docs/AnalysesApi.md b/docs/AnalysesApi.md index 4f773ac..3e426c9 100644 --- a/docs/AnalysesApi.md +++ b/docs/AnalysesApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**annotation_analyses_get**](AnalysesApi.md#annotation_analyses_get) | **GET** /annotation-analyses/ | Get annotation analyses [**annotation_analyses_id_get**](AnalysesApi.md#annotation_analyses_id_get) | **GET** /annotation-analyses/{id} | Your GET endpoint [**annotation_analyses_id_put**](AnalysesApi.md#annotation_analyses_id_put) | **PUT** /annotation-analyses/{id} | Your PUT endpoint +[**annotation_analyses_post**](AnalysesApi.md#annotation_analyses_post) | **POST** /annotation-analyses/ | Your POST endpoint # **analyses_get** @@ -605,3 +606,80 @@ Name | Type | Description | Notes [[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) +# **annotation_analyses_post** +> List[NoteCollectionReturn] annotation_analyses_post(note_collection_request=note_collection_request) + +Your POST endpoint + +This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. + +### Example + +* Bearer Authentication (JSON-Web-Token): +```python +import time +import os +import neurostore_sdk +from neurostore_sdk.models.note_collection_request import NoteCollectionRequest +from neurostore_sdk.models.note_collection_return import NoteCollectionReturn +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: JSON-Web-Token +configuration = neurostore_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.AnalysesApi(api_client) + note_collection_request = [neurostore_sdk.NoteCollectionRequest()] # List[NoteCollectionRequest] | (optional) + + try: + # Your POST endpoint + api_response = api_instance.annotation_analyses_post(note_collection_request=note_collection_request) + print("The response of AnalysesApi->annotation_analyses_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnalysesApi->annotation_analyses_post: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **note_collection_request** | [**List[NoteCollectionRequest]**](NoteCollectionRequest.md)| | [optional] + +### Return type + +[**List[NoteCollectionReturn]**](NoteCollectionReturn.md) + +### Authorization + +[JSON-Web-Token](../README.md#JSON-Web-Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/AnnotationsApi.md b/docs/AnnotationsApi.md index 5240ad8..a610cee 100644 --- a/docs/AnnotationsApi.md +++ b/docs/AnnotationsApi.md @@ -7,6 +7,7 @@ Method | HTTP request | Description [**annotation_analyses_get**](AnnotationsApi.md#annotation_analyses_get) | **GET** /annotation-analyses/ | Get annotation analyses [**annotation_analyses_id_get**](AnnotationsApi.md#annotation_analyses_id_get) | **GET** /annotation-analyses/{id} | Your GET endpoint [**annotation_analyses_id_put**](AnnotationsApi.md#annotation_analyses_id_put) | **PUT** /annotation-analyses/{id} | Your PUT endpoint +[**annotation_analyses_post**](AnnotationsApi.md#annotation_analyses_post) | **POST** /annotation-analyses/ | Your POST endpoint [**annotations_get**](AnnotationsApi.md#annotations_get) | **GET** /annotations/ | Your GET endpoint [**annotations_id_delete**](AnnotationsApi.md#annotations_id_delete) | **DELETE** /annotations/{id} | DELETE an annotation [**annotations_id_get**](AnnotationsApi.md#annotations_id_get) | **GET** /annotations/{id} | Your GET endpoint @@ -226,6 +227,83 @@ Name | Type | Description | Notes [[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) +# **annotation_analyses_post** +> List[NoteCollectionReturn] annotation_analyses_post(note_collection_request=note_collection_request) + +Your POST endpoint + +This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. + +### Example + +* Bearer Authentication (JSON-Web-Token): +```python +import time +import os +import neurostore_sdk +from neurostore_sdk.models.note_collection_request import NoteCollectionRequest +from neurostore_sdk.models.note_collection_return import NoteCollectionReturn +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: JSON-Web-Token +configuration = neurostore_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.AnnotationsApi(api_client) + note_collection_request = [neurostore_sdk.NoteCollectionRequest()] # List[NoteCollectionRequest] | (optional) + + try: + # Your POST endpoint + api_response = api_instance.annotation_analyses_post(note_collection_request=note_collection_request) + print("The response of AnnotationsApi->annotation_analyses_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnnotationsApi->annotation_analyses_post: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **note_collection_request** | [**List[NoteCollectionRequest]**](NoteCollectionRequest.md)| | [optional] + +### Return type + +[**List[NoteCollectionReturn]**](NoteCollectionReturn.md) + +### Authorization + +[JSON-Web-Token](../README.md#JSON-Web-Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **annotations_get** > AnnotationList annotations_get(studyset_id=studyset_id) diff --git a/docs/StoreApi.md b/docs/StoreApi.md index d8ec853..c4e9317 100644 --- a/docs/StoreApi.md +++ b/docs/StoreApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**annotation_analyses_get**](StoreApi.md#annotation_analyses_get) | **GET** /annotation-analyses/ | Get annotation analyses [**annotation_analyses_id_get**](StoreApi.md#annotation_analyses_id_get) | **GET** /annotation-analyses/{id} | Your GET endpoint [**annotation_analyses_id_put**](StoreApi.md#annotation_analyses_id_put) | **PUT** /annotation-analyses/{id} | Your PUT endpoint +[**annotation_analyses_post**](StoreApi.md#annotation_analyses_post) | **POST** /annotation-analyses/ | Your POST endpoint [**annotations_get**](StoreApi.md#annotations_get) | **GET** /annotations/ | Your GET endpoint [**annotations_id_delete**](StoreApi.md#annotations_id_delete) | **DELETE** /annotations/{id} | DELETE an annotation [**annotations_id_get**](StoreApi.md#annotations_id_get) | **GET** /annotations/{id} | Your GET endpoint @@ -638,6 +639,83 @@ Name | Type | Description | Notes [[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) +# **annotation_analyses_post** +> List[NoteCollectionReturn] annotation_analyses_post(note_collection_request=note_collection_request) + +Your POST endpoint + +This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. + +### Example + +* Bearer Authentication (JSON-Web-Token): +```python +import time +import os +import neurostore_sdk +from neurostore_sdk.models.note_collection_request import NoteCollectionRequest +from neurostore_sdk.models.note_collection_return import NoteCollectionReturn +from neurostore_sdk.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://neurostore.org/api +# See configuration.py for a list of all supported configuration parameters. +configuration = neurostore_sdk.Configuration( + host = "https://neurostore.org/api" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: JSON-Web-Token +configuration = neurostore_sdk.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with neurostore_sdk.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = neurostore_sdk.StoreApi(api_client) + note_collection_request = [neurostore_sdk.NoteCollectionRequest()] # List[NoteCollectionRequest] | (optional) + + try: + # Your POST endpoint + api_response = api_instance.annotation_analyses_post(note_collection_request=note_collection_request) + print("The response of StoreApi->annotation_analyses_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling StoreApi->annotation_analyses_post: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **note_collection_request** | [**List[NoteCollectionRequest]**](NoteCollectionRequest.md)| | [optional] + +### Return type + +[**List[NoteCollectionReturn]**](NoteCollectionReturn.md) + +### Authorization + +[JSON-Web-Token](../README.md#JSON-Web-Token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **annotations_get** > AnnotationList annotations_get(studyset_id=studyset_id) diff --git a/neurostore_sdk/api/analyses_api.py b/neurostore_sdk/api/analyses_api.py index c2d4e0a..49f1a2b 100644 --- a/neurostore_sdk/api/analyses_api.py +++ b/neurostore_sdk/api/analyses_api.py @@ -20,9 +20,9 @@ from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, constr +from pydantic import Field, StrictBool, StrictStr, conint, conlist, constr -from typing import Optional +from typing import List, Optional from neurostore_sdk.models.analysis_list import AnalysisList from neurostore_sdk.models.analysis_request import AnalysisRequest @@ -1246,3 +1246,149 @@ def annotation_analyses_id_put_with_http_info(self, id : StrictStr, note_collect _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + + @validate_arguments + def annotation_analyses_post(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> List[NoteCollectionReturn]: # noqa: E501 + """Your POST endpoint # noqa: E501 + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.annotation_analyses_post(note_collection_request, async_req=True) + >>> result = thread.get() + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[NoteCollectionReturn] + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the annotation_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.annotation_analyses_post_with_http_info(note_collection_request, **kwargs) # noqa: E501 + + @validate_arguments + def annotation_analyses_post_with_http_info(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> ApiResponse: # noqa: E501 + """Your POST endpoint # noqa: E501 + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.annotation_analyses_post_with_http_info(note_collection_request, async_req=True) + >>> result = thread.get() + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the 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(List[NoteCollectionReturn], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'note_collection_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method annotation_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['note_collection_request'] is not None: + _body_params = _params['note_collection_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['JSON-Web-Token'] # noqa: E501 + + _response_types_map = { + '200': "List[NoteCollectionReturn]", + } + + return self.api_client.call_api( + '/annotation-analyses/', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) diff --git a/neurostore_sdk/api/annotations_api.py b/neurostore_sdk/api/annotations_api.py index 75442c1..4722fb8 100644 --- a/neurostore_sdk/api/annotations_api.py +++ b/neurostore_sdk/api/annotations_api.py @@ -20,9 +20,9 @@ from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr +from pydantic import Field, StrictBool, StrictStr, conlist -from typing import Optional +from typing import List, Optional from neurostore_sdk.models.annotation_list import AnnotationList from neurostore_sdk.models.annotation_request import AnnotationRequest @@ -470,6 +470,152 @@ def annotation_analyses_id_put_with_http_info(self, id : StrictStr, note_collect collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + @validate_arguments + def annotation_analyses_post(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> List[NoteCollectionReturn]: # noqa: E501 + """Your POST endpoint # noqa: E501 + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.annotation_analyses_post(note_collection_request, async_req=True) + >>> result = thread.get() + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[NoteCollectionReturn] + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the annotation_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.annotation_analyses_post_with_http_info(note_collection_request, **kwargs) # noqa: E501 + + @validate_arguments + def annotation_analyses_post_with_http_info(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> ApiResponse: # noqa: E501 + """Your POST endpoint # noqa: E501 + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.annotation_analyses_post_with_http_info(note_collection_request, async_req=True) + >>> result = thread.get() + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the 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(List[NoteCollectionReturn], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'note_collection_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method annotation_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['note_collection_request'] is not None: + _body_params = _params['note_collection_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['JSON-Web-Token'] # noqa: E501 + + _response_types_map = { + '200': "List[NoteCollectionReturn]", + } + + return self.api_client.call_api( + '/annotation-analyses/', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def annotations_get(self, studyset_id : Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, **kwargs) -> AnnotationList: # noqa: E501 """Your GET endpoint # noqa: E501 diff --git a/neurostore_sdk/api/store_api.py b/neurostore_sdk/api/store_api.py index 06558f4..d3a5d3d 100644 --- a/neurostore_sdk/api/store_api.py +++ b/neurostore_sdk/api/store_api.py @@ -20,9 +20,9 @@ from pydantic import validate_arguments, ValidationError from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, conint, constr +from pydantic import Field, StrictBool, StrictStr, conint, conlist, constr -from typing import Any, Optional +from typing import Any, List, Optional from neurostore_sdk.models.analysis_list import AnalysisList from neurostore_sdk.models.analysis_request import AnalysisRequest @@ -1269,6 +1269,152 @@ def annotation_analyses_id_put_with_http_info(self, id : StrictStr, note_collect collection_formats=_collection_formats, _request_auth=_params.get('_request_auth')) + @validate_arguments + def annotation_analyses_post(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> List[NoteCollectionReturn]: # noqa: E501 + """Your POST endpoint # noqa: E501 + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.annotation_analyses_post(note_collection_request, async_req=True) + >>> result = thread.get() + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: Returns the result object. + If the method is called asynchronously, + returns the request thread. + :rtype: List[NoteCollectionReturn] + """ + kwargs['_return_http_data_only'] = True + if '_preload_content' in kwargs: + raise ValueError("Error! Please call the annotation_analyses_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data") + return self.annotation_analyses_post_with_http_info(note_collection_request, **kwargs) # noqa: E501 + + @validate_arguments + def annotation_analyses_post_with_http_info(self, note_collection_request : Optional[conlist(NoteCollectionRequest)] = None, **kwargs) -> ApiResponse: # noqa: E501 + """Your POST endpoint # noqa: E501 + + This endpoint does not allow for creation, only modification of existing annotation-analyses. If you wish to create an annotation-analysis, post to the annotations endpoint and/or add the analysis to the appropriate study in the studyset, and the annotation-analysis will be created automatically. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.annotation_analyses_post_with_http_info(note_collection_request, async_req=True) + >>> result = thread.get() + + :param note_collection_request: + :type note_collection_request: List[NoteCollectionRequest] + :param async_req: Whether to execute the request asynchronously. + :type async_req: bool, optional + :param _preload_content: if False, the ApiResponse.data will + be set to none and raw_data will store the + HTTP response body without reading/decoding. + Default is True. + :type _preload_content: bool, optional + :param _return_http_data_only: response data instead of ApiResponse + object with status code, headers, etc + :type _return_http_data_only: bool, optional + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :param _request_auth: set to override the 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(List[NoteCollectionReturn], status_code(int), headers(HTTPHeaderDict)) + """ + + _params = locals() + + _all_params = [ + 'note_collection_request' + ] + _all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout', + '_request_auth', + '_content_type', + '_headers' + ] + ) + + # validate the arguments + for _key, _val in _params['kwargs'].items(): + if _key not in _all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method annotation_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['note_collection_request'] is not None: + _body_params = _params['note_collection_request'] + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # set the HTTP header `Content-Type` + _content_types_list = _params.get('_content_type', + self.api_client.select_header_content_type( + ['application/json'])) + if _content_types_list: + _header_params['Content-Type'] = _content_types_list + + # authentication setting + _auth_settings = ['JSON-Web-Token'] # noqa: E501 + + _response_types_map = { + '200': "List[NoteCollectionReturn]", + } + + return self.api_client.call_api( + '/annotation-analyses/', 'POST', + _path_params, + _query_params, + _header_params, + body=_body_params, + post_params=_form_params, + files=_files, + response_types_map=_response_types_map, + auth_settings=_auth_settings, + async_req=_params.get('async_req'), + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=_params.get('_preload_content', True), + _request_timeout=_params.get('_request_timeout'), + collection_formats=_collection_formats, + _request_auth=_params.get('_request_auth')) + @validate_arguments def annotations_get(self, studyset_id : Annotated[Optional[StrictStr], Field(description="see all annotations connected to this studyset")] = None, **kwargs) -> AnnotationList: # noqa: E501 """Your GET endpoint # noqa: E501