diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 34185f00..9864ed36 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -57,6 +57,7 @@ docs/PatientCreateRequest.md docs/PatientCreateResponse.md docs/PatientId.md docs/PatientResourceName.md +docs/ProgrammingLanguage.md docs/ResourceSource.md docs/ResponsePageMetadata.md docs/ResponsePageMetadataLinks.md @@ -81,15 +82,15 @@ docs/TextIdAnnotationAllOf.md docs/TextIdAnnotationApi.md docs/TextIdAnnotationRequest.md docs/TextIdAnnotationResponse.md +docs/TextLocationAnnotation.md +docs/TextLocationAnnotationAllOf.md +docs/TextLocationAnnotationApi.md +docs/TextLocationAnnotationRequest.md +docs/TextLocationAnnotationResponse.md docs/TextPersonNameAnnotation.md docs/TextPersonNameAnnotationApi.md docs/TextPersonNameAnnotationRequest.md docs/TextPersonNameAnnotationResponse.md -docs/TextPhysicalAddressAnnotation.md -docs/TextPhysicalAddressAnnotationAllOf.md -docs/TextPhysicalAddressAnnotationApi.md -docs/TextPhysicalAddressAnnotationRequest.md -docs/TextPhysicalAddressAnnotationResponse.md docs/Tool.md docs/ToolApi.md docs/ToolDependencies.md @@ -108,8 +109,8 @@ nlpsandbox/api/text_contact_annotation_api.py nlpsandbox/api/text_covid_symptom_annotation_api.py nlpsandbox/api/text_date_annotation_api.py nlpsandbox/api/text_id_annotation_api.py +nlpsandbox/api/text_location_annotation_api.py nlpsandbox/api/text_person_name_annotation_api.py -nlpsandbox/api/text_physical_address_annotation_api.py nlpsandbox/api/tool_api.py nlpsandbox/api_client.py nlpsandbox/apis/__init__.py @@ -167,6 +168,7 @@ nlpsandbox/model/patient_create_request.py nlpsandbox/model/patient_create_response.py nlpsandbox/model/patient_id.py nlpsandbox/model/patient_resource_name.py +nlpsandbox/model/programming_language.py nlpsandbox/model/resource_source.py nlpsandbox/model/response_page_metadata.py nlpsandbox/model/response_page_metadata_links.py @@ -187,13 +189,13 @@ nlpsandbox/model/text_id_annotation.py nlpsandbox/model/text_id_annotation_all_of.py nlpsandbox/model/text_id_annotation_request.py nlpsandbox/model/text_id_annotation_response.py +nlpsandbox/model/text_location_annotation.py +nlpsandbox/model/text_location_annotation_all_of.py +nlpsandbox/model/text_location_annotation_request.py +nlpsandbox/model/text_location_annotation_response.py nlpsandbox/model/text_person_name_annotation.py nlpsandbox/model/text_person_name_annotation_request.py nlpsandbox/model/text_person_name_annotation_response.py -nlpsandbox/model/text_physical_address_annotation.py -nlpsandbox/model/text_physical_address_annotation_all_of.py -nlpsandbox/model/text_physical_address_annotation_request.py -nlpsandbox/model/text_physical_address_annotation_response.py nlpsandbox/model/tool.py nlpsandbox/model/tool_dependencies.py nlpsandbox/model/tool_type.py @@ -201,3 +203,100 @@ nlpsandbox/model_utils.py nlpsandbox/models/__init__.py nlpsandbox/rest.py test/__init__.py +test/test_annotation.py +test/test_annotation_api.py +test/test_annotation_create_request.py +test/test_annotation_create_response.py +test/test_annotation_id.py +test/test_annotation_name.py +test/test_annotation_set.py +test/test_annotation_source.py +test/test_annotation_store.py +test/test_annotation_store_api.py +test/test_annotation_store_create_response.py +test/test_annotation_store_id.py +test/test_annotation_store_name.py +test/test_dataset.py +test/test_dataset_api.py +test/test_dataset_create_response.py +test/test_dataset_id.py +test/test_dataset_name.py +test/test_date_offset_config.py +test/test_deidentification_step.py +test/test_deidentified_note_api.py +test/test_deidentify_request.py +test/test_deidentify_response.py +test/test_error.py +test/test_fhir_store.py +test/test_fhir_store_api.py +test/test_fhir_store_create_response.py +test/test_fhir_store_id.py +test/test_fhir_store_name.py +test/test_health_check.py +test/test_health_check_api.py +test/test_license.py +test/test_masking_char_config.py +test/test_note.py +test/test_note_api.py +test/test_note_create_request.py +test/test_note_create_response.py +test/test_note_id.py +test/test_note_resource_name.py +test/test_page_limit.py +test/test_page_of_annotation_stores.py +test/test_page_of_annotation_stores_all_of.py +test/test_page_of_annotations.py +test/test_page_of_annotations_all_of.py +test/test_page_of_datasets.py +test/test_page_of_datasets_all_of.py +test/test_page_of_fhir_stores.py +test/test_page_of_fhir_stores_all_of.py +test/test_page_of_notes.py +test/test_page_of_notes_all_of.py +test/test_page_of_patients.py +test/test_page_of_patients_all_of.py +test/test_page_offset.py +test/test_patient.py +test/test_patient_api.py +test/test_patient_create_request.py +test/test_patient_create_response.py +test/test_patient_id.py +test/test_patient_resource_name.py +test/test_programming_language.py +test/test_resource_source.py +test/test_response_page_metadata.py +test/test_response_page_metadata_links.py +test/test_text_annotation.py +test/test_text_contact_annotation.py +test/test_text_contact_annotation_all_of.py +test/test_text_contact_annotation_api.py +test/test_text_contact_annotation_request.py +test/test_text_contact_annotation_response.py +test/test_text_covid_symptom_annotation.py +test/test_text_covid_symptom_annotation_all_of.py +test/test_text_covid_symptom_annotation_api.py +test/test_text_covid_symptom_annotation_request.py +test/test_text_covid_symptom_annotation_response.py +test/test_text_date_annotation.py +test/test_text_date_annotation_all_of.py +test/test_text_date_annotation_api.py +test/test_text_date_annotation_request.py +test/test_text_date_annotation_response.py +test/test_text_id_annotation.py +test/test_text_id_annotation_all_of.py +test/test_text_id_annotation_api.py +test/test_text_id_annotation_request.py +test/test_text_id_annotation_response.py +test/test_text_location_annotation.py +test/test_text_location_annotation_all_of.py +test/test_text_location_annotation_api.py +test/test_text_location_annotation_request.py +test/test_text_location_annotation_response.py +test/test_text_person_name_annotation.py +test/test_text_person_name_annotation_api.py +test/test_text_person_name_annotation_request.py +test/test_text_person_name_annotation_response.py +test/test_tool.py +test/test_tool_api.py +test/test_tool_dependencies.py +test/test_tool_type.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 3bff0591..e230c839 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.1 \ No newline at end of file +5.3.0 \ No newline at end of file diff --git a/docs/Annotation.md b/docs/Annotation.md index e2b6064e..75c44e84 100644 --- a/docs/Annotation.md +++ b/docs/Annotation.md @@ -9,10 +9,11 @@ Name | Type | Description | Notes **annotation_source** | [**AnnotationSource**](AnnotationSource.md) | | **text_date_annotations** | [**[TextDateAnnotation]**](TextDateAnnotation.md) | Date annotations in a text | [optional] **text_person_name_annotations** | [**[TextPersonNameAnnotation]**](TextPersonNameAnnotation.md) | Person name annotations in a text | [optional] -**text_physical_address_annotations** | [**[TextPhysicalAddressAnnotation]**](TextPhysicalAddressAnnotation.md) | Physical address annotations in a text | [optional] +**text_location_annotations** | [**[TextLocationAnnotation]**](TextLocationAnnotation.md) | Location annotations in a text | [optional] **text_id_annotations** | [**[TextIdAnnotation]**](TextIdAnnotation.md) | ID annotations in a text | [optional] **text_contact_annotations** | [**[TextContactAnnotation]**](TextContactAnnotation.md) | Contact annotations in a text | [optional] **text_covid_symptom_annotations** | [**[TextCovidSymptomAnnotation]**](TextCovidSymptomAnnotation.md) | COVID symptom annotations in a text | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/AnnotationApi.md b/docs/AnnotationApi.md index e780014b..522af790 100644 --- a/docs/AnnotationApi.md +++ b/docs/AnnotationApi.md @@ -19,6 +19,8 @@ Create an annotation ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -36,9 +38,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_api.AnnotationApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -56,8 +68,8 @@ with nlpsandbox.ApiClient() as api_client: text_person_name_annotations=[ TextPersonNameAnnotation(), ], - text_physical_address_annotations=[ - TextPhysicalAddressAnnotation(), + text_location_annotations=[ + TextLocationAnnotation(), ], text_id_annotations=[ TextIdAnnotation(), @@ -104,7 +116,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -113,6 +125,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Success | - | @@ -131,6 +144,8 @@ Deletes the annotation specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -146,9 +161,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_api.AnnotationApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -179,7 +204,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -188,6 +213,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -205,6 +231,8 @@ Returns the annotation specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -221,9 +249,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_api.AnnotationApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -254,7 +292,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -263,6 +301,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -280,6 +319,8 @@ Returns the annotations in an annotation store ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -297,9 +338,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_api.AnnotationApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -341,7 +392,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -350,6 +401,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/AnnotationCreateRequest.md b/docs/AnnotationCreateRequest.md index 30e3534b..75e911c6 100644 --- a/docs/AnnotationCreateRequest.md +++ b/docs/AnnotationCreateRequest.md @@ -8,10 +8,11 @@ Name | Type | Description | Notes **annotation_source** | [**AnnotationSource**](AnnotationSource.md) | | **text_date_annotations** | [**[TextDateAnnotation]**](TextDateAnnotation.md) | Date annotations in a text | [optional] **text_person_name_annotations** | [**[TextPersonNameAnnotation]**](TextPersonNameAnnotation.md) | Person name annotations in a text | [optional] -**text_physical_address_annotations** | [**[TextPhysicalAddressAnnotation]**](TextPhysicalAddressAnnotation.md) | Physical address annotations in a text | [optional] +**text_location_annotations** | [**[TextLocationAnnotation]**](TextLocationAnnotation.md) | Location annotations in a text | [optional] **text_id_annotations** | [**[TextIdAnnotation]**](TextIdAnnotation.md) | ID annotations in a text | [optional] **text_contact_annotations** | [**[TextContactAnnotation]**](TextContactAnnotation.md) | Contact annotations in a text | [optional] **text_covid_symptom_annotations** | [**[TextCovidSymptomAnnotation]**](TextCovidSymptomAnnotation.md) | COVID symptom annotations in a text | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/AnnotationCreateResponse.md b/docs/AnnotationCreateResponse.md index 74cba52d..6b4e56a3 100644 --- a/docs/AnnotationCreateResponse.md +++ b/docs/AnnotationCreateResponse.md @@ -6,6 +6,7 @@ The reference to the annotation created Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**AnnotationName**](AnnotationName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/AnnotationSet.md b/docs/AnnotationSet.md index ff42d018..15aef78b 100644 --- a/docs/AnnotationSet.md +++ b/docs/AnnotationSet.md @@ -7,9 +7,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text_date_annotations** | [**[TextDateAnnotation]**](TextDateAnnotation.md) | Date annotations in a text | **text_person_name_annotations** | [**[TextPersonNameAnnotation]**](TextPersonNameAnnotation.md) | Person name annotations in a text | -**text_physical_address_annotations** | [**[TextPhysicalAddressAnnotation]**](TextPhysicalAddressAnnotation.md) | Physical address annotations in a text | +**text_location_annotations** | [**[TextLocationAnnotation]**](TextLocationAnnotation.md) | Location annotations in a text | **text_id_annotations** | [**[TextIdAnnotation]**](TextIdAnnotation.md) | ID annotations in a text | **text_contact_annotations** | [**[TextContactAnnotation]**](TextContactAnnotation.md) | Contact annotations in a text | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/AnnotationSource.md b/docs/AnnotationSource.md index c5ce91cd..1ed08e5a 100644 --- a/docs/AnnotationSource.md +++ b/docs/AnnotationSource.md @@ -6,6 +6,7 @@ The source of an annotation record Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **resource_source** | [**ResourceSource**](ResourceSource.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/AnnotationStore.md b/docs/AnnotationStore.md index 1813b6cb..794daf23 100644 --- a/docs/AnnotationStore.md +++ b/docs/AnnotationStore.md @@ -6,6 +6,7 @@ An annotation store Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**AnnotationStoreName**](AnnotationStoreName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/AnnotationStoreApi.md b/docs/AnnotationStoreApi.md index a6b9aab4..b882958b 100644 --- a/docs/AnnotationStoreApi.md +++ b/docs/AnnotationStoreApi.md @@ -19,6 +19,8 @@ Create an annotation store with the ID specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -34,9 +36,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_store_api.AnnotationStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -76,7 +88,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -85,6 +97,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Success | - | @@ -103,6 +116,8 @@ Deletes the annotation store specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -117,9 +132,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_store_api.AnnotationStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -148,7 +173,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -157,6 +182,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -174,6 +200,8 @@ Returns the annotation store specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -189,9 +217,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_store_api.AnnotationStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -220,7 +258,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -229,6 +267,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -246,6 +285,8 @@ Returns the annotation stores ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -262,9 +303,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = annotation_store_api.AnnotationStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -304,7 +355,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -313,6 +364,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/AnnotationStoreCreateResponse.md b/docs/AnnotationStoreCreateResponse.md index 3939f658..ffedaaad 100644 --- a/docs/AnnotationStoreCreateResponse.md +++ b/docs/AnnotationStoreCreateResponse.md @@ -6,6 +6,7 @@ The reference to the annotation store created Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**AnnotationStoreName**](AnnotationStoreName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/Dataset.md b/docs/Dataset.md index 0992285e..08d3684c 100644 --- a/docs/Dataset.md +++ b/docs/Dataset.md @@ -6,6 +6,7 @@ A dataset Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**DatasetName**](DatasetName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/DatasetApi.md b/docs/DatasetApi.md index f605ffcd..6d47e811 100644 --- a/docs/DatasetApi.md +++ b/docs/DatasetApi.md @@ -19,6 +19,8 @@ Create a dataset with the name specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -33,9 +35,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dataset_api.DatasetApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset that is being created @@ -73,7 +85,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -82,6 +94,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Success | - | @@ -100,6 +113,8 @@ Deletes the dataset for a given ID ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -113,9 +128,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dataset_api.DatasetApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -142,7 +167,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -151,6 +176,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -168,6 +194,8 @@ Returns the dataset for a given ID ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -182,9 +210,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dataset_api.DatasetApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -211,7 +249,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -220,6 +258,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -237,6 +276,8 @@ Returns the datasets ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -252,9 +293,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dataset_api.DatasetApi(api_client) limit = PageLimit(10) # PageLimit | Maximum number of results returned (optional) @@ -284,7 +335,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -293,6 +344,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/DatasetApi.rst b/docs/DatasetApi.rst deleted file mode 100644 index 78d05305..00000000 --- a/docs/DatasetApi.rst +++ /dev/null @@ -1,408 +0,0 @@ - -datanode.DatasetApi -=================== - -All URIs are relative to *http://example.com/api/v1* - -.. list-table:: - :header-rows: 1 - - * - Method - - HTTP request - - Description - * - `\ **create_dataset** `_ - - **POST** /datasets - - Create a dataset - * - `\ **delete_dataset** `_ - - **DELETE** /datasets/{datasetId} - - Delete a dataset by ID - * - `\ **get_dataset** `_ - - **GET** /datasets/{datasetId} - - Get a dataset by ID - * - `\ **list_datasets** `_ - - **GET** /datasets - - Get all datasets - - -**create_dataset** -====================== - -.. - - Dataset create_dataset(dataset_id, dataset=dataset) - - -Create a dataset - -Create a dataset with the name specified - -Example -^^^^^^^ - -.. code-block:: python - - from __future__ import print_function - import time - import datanode - from datanode.rest import ApiException - from pprint import pprint - # Defining the host is optional and defaults to http://example.com/api/v1 - # See configuration.py for a list of all supported configuration parameters. - configuration = datanode.Configuration( - host = "http://example.com/api/v1" - ) - - - # Enter a context with an instance of the API client - with datanode.ApiClient() as api_client: - # Create an instance of the API class - api_instance = datanode.DatasetApi(api_client) - dataset_id = 'awesome-dataset' # str | The ID of the dataset that is being created. - dataset = datanode.Dataset() # Dataset | (optional) - - try: - # Create a dataset - api_response = api_instance.create_dataset(dataset_id, dataset=dataset) - pprint(api_response) - except ApiException as e: - print("Exception when calling DatasetApi->create_dataset: %s\n" % e) - -Parameters -^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Name - - Type - - Description - - Notes - * - **dataset_id** - - **str** - - The ID of the dataset that is being created. - - - * - **dataset** - - `\ **Dataset** `_ - - - - [optional] - - -Return type -^^^^^^^^^^^ - -`\ **Dataset** `_ - -Authorization -^^^^^^^^^^^^^ - -No authorization required - -HTTP request headers -^^^^^^^^^^^^^^^^^^^^ - - -* **Content-Type**\ : application/json -* **Accept**\ : application/json - -HTTP response details -^^^^^^^^^^^^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Status code - - Description - - Response headers - * - - - -**200** | Success | - | -**403** | Unauthorized | - | -**404** | The specified resource was not found | - | -**409** | The request conflicts with current state of the target resource | - | - -`[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>`_ - -**delete_dataset** -====================== - -.. - - Dataset delete_dataset(dataset_id) - - -Delete a dataset by ID - -Deletes the dataset for a given ID - -Example -^^^^^^^ - -.. code-block:: python - - from __future__ import print_function - import time - import datanode - from datanode.rest import ApiException - from pprint import pprint - # Defining the host is optional and defaults to http://example.com/api/v1 - # See configuration.py for a list of all supported configuration parameters. - configuration = datanode.Configuration( - host = "http://example.com/api/v1" - ) - - - # Enter a context with an instance of the API client - with datanode.ApiClient() as api_client: - # Create an instance of the API class - api_instance = datanode.DatasetApi(api_client) - dataset_id = 'dataset_id_example' # str | The ID of the dataset - - try: - # Delete a dataset by ID - api_response = api_instance.delete_dataset(dataset_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling DatasetApi->delete_dataset: %s\n" % e) - -Parameters -^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Name - - Type - - Description - - Notes - * - **dataset_id** - - **str** - - The ID of the dataset - - - - -Return type -^^^^^^^^^^^ - -`\ **Dataset** `_ - -Authorization -^^^^^^^^^^^^^ - -No authorization required - -HTTP request headers -^^^^^^^^^^^^^^^^^^^^ - - -* **Content-Type**\ : Not defined -* **Accept**\ : application/json - -HTTP response details -^^^^^^^^^^^^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Status code - - Description - - Response headers - * - - - -**200** | Success | - | -**403** | Unauthorized | - | -**404** | The specified resource was not found | - | - -`[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>`_ - -**get_dataset** -=================== - -.. - - Dataset get_dataset(dataset_id) - - -Get a dataset by ID - -Returns the dataset for a given ID - -Example -^^^^^^^ - -.. code-block:: python - - from __future__ import print_function - import time - import datanode - from datanode.rest import ApiException - from pprint import pprint - # Defining the host is optional and defaults to http://example.com/api/v1 - # See configuration.py for a list of all supported configuration parameters. - configuration = datanode.Configuration( - host = "http://example.com/api/v1" - ) - - - # Enter a context with an instance of the API client - with datanode.ApiClient() as api_client: - # Create an instance of the API class - api_instance = datanode.DatasetApi(api_client) - dataset_id = 'dataset_id_example' # str | The ID of the dataset - - try: - # Get a dataset by ID - api_response = api_instance.get_dataset(dataset_id) - pprint(api_response) - except ApiException as e: - print("Exception when calling DatasetApi->get_dataset: %s\n" % e) - -Parameters -^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Name - - Type - - Description - - Notes - * - **dataset_id** - - **str** - - The ID of the dataset - - - - -Return type -^^^^^^^^^^^ - -`\ **Dataset** `_ - -Authorization -^^^^^^^^^^^^^ - -No authorization required - -HTTP request headers -^^^^^^^^^^^^^^^^^^^^ - - -* **Content-Type**\ : Not defined -* **Accept**\ : application/json - -HTTP response details -^^^^^^^^^^^^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Status code - - Description - - Response headers - * - - - -**200** | Success | - | -**403** | Unauthorized | - | -**404** | The specified resource was not found | - | - -`[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>`_ - -**list_datasets** -===================== - -.. - - PageOfDatasets list_datasets(limit=limit, offset=offset) - - -Get all datasets - -Returns the datasets - -Example -^^^^^^^ - -.. code-block:: python - - from __future__ import print_function - import time - import datanode - from datanode.rest import ApiException - from pprint import pprint - # Defining the host is optional and defaults to http://example.com/api/v1 - # See configuration.py for a list of all supported configuration parameters. - configuration = datanode.Configuration( - host = "http://example.com/api/v1" - ) - - - # Enter a context with an instance of the API client - with datanode.ApiClient() as api_client: - # Create an instance of the API class - api_instance = datanode.DatasetApi(api_client) - limit = 10 # int | Maximum number of results returned (optional) (default to 10) - offset = 0 # int | Index of the first result that must be returned (optional) (default to 0) - - try: - # Get all datasets - api_response = api_instance.list_datasets(limit=limit, offset=offset) - pprint(api_response) - except ApiException as e: - print("Exception when calling DatasetApi->list_datasets: %s\n" % e) - -Parameters -^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Name - - Type - - Description - - Notes - * - **limit** - - **int** - - Maximum number of results returned - - [optional] [default to 10] - * - **offset** - - **int** - - Index of the first result that must be returned - - [optional] [default to 0] - - -Return type -^^^^^^^^^^^ - -`\ **PageOfDatasets** `_ - -Authorization -^^^^^^^^^^^^^ - -No authorization required - -HTTP request headers -^^^^^^^^^^^^^^^^^^^^ - - -* **Content-Type**\ : Not defined -* **Accept**\ : application/json - -HTTP response details -^^^^^^^^^^^^^^^^^^^^^ - -.. list-table:: - :header-rows: 1 - - * - Status code - - Description - - Response headers - * - - - -**200** | Success | - | -**403** | Unauthorized | - | -**404** | The specified resource was not found | - | - -`[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/DatasetCreateResponse.md b/docs/DatasetCreateResponse.md index 90123296..b30ec3c3 100644 --- a/docs/DatasetCreateResponse.md +++ b/docs/DatasetCreateResponse.md @@ -6,6 +6,7 @@ The reference of the dataset created Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**DatasetName**](DatasetName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/DateOffsetConfig.md b/docs/DateOffsetConfig.md index bcfed1b2..f083d551 100644 --- a/docs/DateOffsetConfig.md +++ b/docs/DateOffsetConfig.md @@ -6,6 +6,7 @@ Configuration for the \"date offset\" strategy. E.g. \"John Smith visited on 1 J Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **offset_days** | **int** | Number of days by which to offset annotated dates. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/DeidentificationStep.md b/docs/DeidentificationStep.md index 44668f3d..6bd21c0f 100644 --- a/docs/DeidentificationStep.md +++ b/docs/DeidentificationStep.md @@ -8,9 +8,10 @@ Name | Type | Description | Notes **annotation_types** | **[str]** | The types of annotations to which the de-identifer should apply the selected strategy | **confidence_threshold** | **float** | The minimum confidence level for a given annotation to be de-identified | [optional] if omitted the server will use the default value of 0 **masking_char_config** | [**MaskingCharConfig**](MaskingCharConfig.md) | | [optional] -**annotation_type_mask_config** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Configuration for the \"annotation type\" strategy. E.g. \"John Smith lives at 123 Main St\" -> \"[PERSON_NAME] lives at [PHYSICAL_ADDRESS]\". | [optional] +**annotation_type_mask_config** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Configuration for the \"annotation type\" strategy. E.g. \"John Smith lives at 123 Main St\" -> \"[PERSON_NAME] lives at [LOCATION]\". | [optional] **redact_config** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Configuration for the redaction strategy. E.g. \"John Smith lives at 123 Main St\" -> \"lives at\". | [optional] **date_offset_config** | [**DateOffsetConfig**](DateOffsetConfig.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/DeidentifiedNoteApi.md b/docs/DeidentifiedNoteApi.md index 6b9e4bf3..a61c8125 100644 --- a/docs/DeidentifiedNoteApi.md +++ b/docs/DeidentifiedNoteApi.md @@ -16,6 +16,7 @@ Returns the deidentified note ### Example + ```python import time import nlpsandbox @@ -92,6 +93,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/DeidentifyRequest.md b/docs/DeidentifyRequest.md index 037a5015..60ef5836 100644 --- a/docs/DeidentifyRequest.md +++ b/docs/DeidentifyRequest.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | **deidentification_steps** | [**[DeidentificationStep]**](DeidentificationStep.md) | A list of deidentification steps | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/DeidentifyResponse.md b/docs/DeidentifyResponse.md index 09636a2b..9d69aeb0 100644 --- a/docs/DeidentifyResponse.md +++ b/docs/DeidentifyResponse.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **original_annotations** | [**AnnotationSet**](AnnotationSet.md) | | [optional] **deidentified_annotations** | [**AnnotationSet**](AnnotationSet.md) | | [optional] **deidentified_note** | [**Note**](Note.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/Error.md b/docs/Error.md index 7696a968..de704ae7 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **status** | **int** | The HTTP status code | **detail** | **str** | A human readable explanation specific to this occurrence of the problem | [optional] **type** | **str** | An absolute URI that identifies the problem type | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/FhirStore.md b/docs/FhirStore.md index 574f1aa6..950ed32f 100644 --- a/docs/FhirStore.md +++ b/docs/FhirStore.md @@ -6,6 +6,7 @@ A FHIR store Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**FhirStoreName**](FhirStoreName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/FhirStoreApi.md b/docs/FhirStoreApi.md index b2636e03..92f69aa9 100644 --- a/docs/FhirStoreApi.md +++ b/docs/FhirStoreApi.md @@ -19,6 +19,8 @@ Create a FHIR store with the ID specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -34,9 +36,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fhir_store_api.FhirStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -76,7 +88,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -85,6 +97,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Success | - | @@ -103,6 +116,8 @@ Deletes the FHIR store specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -117,9 +132,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fhir_store_api.FhirStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -148,7 +173,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -157,6 +182,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -174,6 +200,8 @@ Returns the FHIR store specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -189,9 +217,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fhir_store_api.FhirStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -220,7 +258,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -229,6 +267,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -246,6 +285,8 @@ Returns the FHIR stores ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -262,9 +303,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fhir_store_api.FhirStoreApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -304,7 +355,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -313,6 +364,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/FhirStoreCreateResponse.md b/docs/FhirStoreCreateResponse.md index 6364a00f..34b9a842 100644 --- a/docs/FhirStoreCreateResponse.md +++ b/docs/FhirStoreCreateResponse.md @@ -6,6 +6,7 @@ The reference to the FHIR store created Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**FhirStoreName**](FhirStoreName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/HealthCheck.md b/docs/HealthCheck.md index 5fdbd34c..e44e3055 100644 --- a/docs/HealthCheck.md +++ b/docs/HealthCheck.md @@ -6,6 +6,7 @@ Represents the health of a service Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **str** | Indicates whether the service status is acceptable or not | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/HealthCheckApi.md b/docs/HealthCheckApi.md index 299100e6..f20dc4fa 100644 --- a/docs/HealthCheckApi.md +++ b/docs/HealthCheckApi.md @@ -16,6 +16,7 @@ Get information about the health of the service ### Example + ```python import time import nlpsandbox @@ -63,6 +64,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 298ea9e2..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/MaskingCharConfig.md b/docs/MaskingCharConfig.md index fdf410eb..d2d39f4d 100644 --- a/docs/MaskingCharConfig.md +++ b/docs/MaskingCharConfig.md @@ -6,6 +6,7 @@ Configuration for the masking char strategy. E.g. \"John Smith lives at 123 Main Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **masking_char** | **str** | Character used to mask sensitive information | [optional] if omitted the server will use the default value of "*" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/Note.md b/docs/Note.md index 292f5d2e..5a2a2d66 100644 --- a/docs/Note.md +++ b/docs/Note.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **text** | **str** | The content of the clinical note | **type** | **str** | The note type (LOINC concept) | **patient_id** | [**PatientId**](PatientId.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/NoteApi.md b/docs/NoteApi.md index bbe88b75..00b71d15 100644 --- a/docs/NoteApi.md +++ b/docs/NoteApi.md @@ -19,6 +19,8 @@ Create a note ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -36,9 +38,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = note_api.NoteApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -84,7 +96,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -93,6 +105,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Success | - | @@ -111,6 +124,8 @@ Deletes the note specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -126,9 +141,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = note_api.NoteApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -159,7 +184,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -168,6 +193,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -185,6 +211,8 @@ Returns the note specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -201,9 +229,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = note_api.NoteApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -234,7 +272,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -243,6 +281,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -260,6 +299,8 @@ Returns the notes in a FHIR store ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -277,9 +318,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = note_api.NoteApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -321,7 +372,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -330,6 +381,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/NoteCreateRequest.md b/docs/NoteCreateRequest.md index 3d309056..94ed03ab 100644 --- a/docs/NoteCreateRequest.md +++ b/docs/NoteCreateRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **text** | **str** | The content of the clinical note | **type** | **str** | The note type (LOINC concept) | **patient_id** | [**PatientId**](PatientId.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/NoteCreateResponse.md b/docs/NoteCreateResponse.md index 0f701309..73d4ce0b 100644 --- a/docs/NoteCreateResponse.md +++ b/docs/NoteCreateResponse.md @@ -6,6 +6,7 @@ The reference to the note created Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**NoteResourceName**](NoteResourceName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PageOfAnnotationStoresAllOf.md b/docs/PageOfAnnotationStoresAllOf.md index 3352252e..bac63229 100644 --- a/docs/PageOfAnnotationStoresAllOf.md +++ b/docs/PageOfAnnotationStoresAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **annotation_stores** | [**[AnnotationStore]**](AnnotationStore.md) | An array of annotation stores | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PageOfAnnotationsAllOf.md b/docs/PageOfAnnotationsAllOf.md index c2872966..fe0d4fc4 100644 --- a/docs/PageOfAnnotationsAllOf.md +++ b/docs/PageOfAnnotationsAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **annotations** | [**[Annotation]**](Annotation.md) | An array of annotations | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PageOfDatasetsAllOf.md b/docs/PageOfDatasetsAllOf.md index c200e50a..6708a6c7 100644 --- a/docs/PageOfDatasetsAllOf.md +++ b/docs/PageOfDatasetsAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **datasets** | [**[Dataset]**](Dataset.md) | An array of datasets | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PageOfFhirStoresAllOf.md b/docs/PageOfFhirStoresAllOf.md index 429b522e..fd77a42e 100644 --- a/docs/PageOfFhirStoresAllOf.md +++ b/docs/PageOfFhirStoresAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **fhir_stores** | [**[FhirStore]**](FhirStore.md) | An array of FHIR stores | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PageOfNotesAllOf.md b/docs/PageOfNotesAllOf.md index 9daf21ca..3d4a8eb8 100644 --- a/docs/PageOfNotesAllOf.md +++ b/docs/PageOfNotesAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **notes** | [**[Note]**](Note.md) | An array of notes | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PageOfPatientsAllOf.md b/docs/PageOfPatientsAllOf.md index 36f5bdbf..ed73c7ee 100644 --- a/docs/PageOfPatientsAllOf.md +++ b/docs/PageOfPatientsAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **patients** | [**[Patient]**](Patient.md) | An array of FHIR patients | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/Patient.md b/docs/Patient.md index 1d862efe..1ae33150 100644 --- a/docs/Patient.md +++ b/docs/Patient.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **identifier** | [**PatientId**](PatientId.md) | | **gender** | **str** | Gender of the patient | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PatientApi.md b/docs/PatientApi.md index c05911d1..bd0f9911 100644 --- a/docs/PatientApi.md +++ b/docs/PatientApi.md @@ -19,6 +19,8 @@ Create a FHIR patient ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -36,9 +38,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = patient_api.PatientApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -82,7 +94,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -91,6 +103,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **201** | Success | - | @@ -109,6 +122,8 @@ Deletes the FHIR patient specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -124,9 +139,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = patient_api.PatientApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -157,7 +182,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -166,6 +191,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -183,6 +209,8 @@ Returns the FHIR patient specified ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -199,9 +227,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = patient_api.PatientApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -232,7 +270,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -241,6 +279,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -258,6 +297,8 @@ Returns the Patients in a FHIR store ### Example +* Api Key Authentication (ApiKeyAuth): + ```python import time import nlpsandbox @@ -275,9 +316,19 @@ configuration = nlpsandbox.Configuration( host = "http://example.com/api/v1" ) +# 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 API key authorization: ApiKeyAuth +configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' # Enter a context with an instance of the API client -with nlpsandbox.ApiClient() as api_client: +with nlpsandbox.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = patient_api.PatientApi(api_client) dataset_id = DatasetId("awesome-dataset") # DatasetId | The ID of the dataset @@ -319,7 +370,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[ApiKeyAuth](../README.md#ApiKeyAuth) ### HTTP request headers @@ -328,6 +379,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/PatientCreateRequest.md b/docs/PatientCreateRequest.md index 6278f8db..5a136ce3 100644 --- a/docs/PatientCreateRequest.md +++ b/docs/PatientCreateRequest.md @@ -6,6 +6,7 @@ A FHIR patient Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **gender** | **str** | Gender of the patient | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/PatientCreateResponse.md b/docs/PatientCreateResponse.md index f11bb3cf..b9694611 100644 --- a/docs/PatientCreateResponse.md +++ b/docs/PatientCreateResponse.md @@ -6,6 +6,7 @@ The reference to the patient created Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | [**PatientResourceName**](PatientResourceName.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/ProgrammingLanguage.md b/docs/ProgrammingLanguage.md new file mode 100644 index 00000000..ff37279d --- /dev/null +++ b/docs/ProgrammingLanguage.md @@ -0,0 +1,12 @@ +# ProgrammingLanguage + +A programming language + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **str** | A programming language | must be one of ["APL", "ASP", "Ada", "Assembly", "Awk", "Basic", "C", "C#", "C++", "Clojure", "Cython", "Dart", "Delphi/Kylix", "Emacs-Lisp", "Erlang", "Euler", "Forth", "Fortran", "Go", "Groovy", "Haskell", "Java", "JavaScript", "Julia", "Kotlin", "Lisp", "Logo", "MATLAB", "ML", "OCaml", "Object Pascal", "Objective C", "Other", "Other Scripting Engines", "PHP", "PL/SQL", "Pascal", "Perl", "Pike", "Prolog", "Python", "R", "REBOL", "Rexx", "Ruby", "Rust", "Scala", "Scheme", "SQL", "Tcl", "TypeScript", "Unix Shell", "Visual Basic", "YACC", "Zope", ] + +[[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/README.rst b/docs/README.rst deleted file mode 100644 index 643be084..00000000 --- a/docs/README.rst +++ /dev/null @@ -1,74 +0,0 @@ -***************** -nlpsandbox-client -***************** - -**nlpsandboxclient** is a set of tools and commands that provides an interface -for NLP sandbox data node, annotation services, and evaluation of annotation results. -This repository consists of 3 packages: - -- **datanode**: Python SDK client that wraps `data-node API`_ -- **annotator**: Python SDK client for the NLP annotators `date-annotator API`_, `person-name-annotator API`_, `physical-address-annotator API`_ -- **nlpsandboxclient**: Uses **datanode**, **annotator** to interact with NLP services and the synapseclient_ library to pull information from Synapse (account required). - -.. _Synapse: https://www.synapse.org/ -.. _synapseclient: https://python-docs.synapse.org/build/html/index.html -.. _data-node API: https://nlpsandbox.github.io/nlpsandbox-schemas/data-node/latest/openapi.json -.. _date-annotator API: https://nlpsandbox.github.io/nlpsandbox-schemas/date-annotator/latest/openapi.json -.. _person-name-annotator API: https://nlpsandbox.github.io/nlpsandbox-schemas/person-name-annotator/latest/openapi.json -.. _physical-address-annotator API: https://nlpsandbox.github.io/nlpsandbox-schemas/physical-address-annotator/latest/openapi.json - -Installation -============ -To install from pypi: - -.. code:: console - - $ pip install nlpsandbox-client - -To install from the source: - -.. code:: console - - $ python setup.py install - -Configuration -============= -This client interfaces with the data-node_ or annotators such as date-annotator-example_. -There are two main ways of running this code, and each way has its preferred method -of setting Synapse credentials. - -(1) Local Python Installation: Please learn more about `Synapse client configuration`_. - -.. code:: console - - nlp-cli --version - -(2) Docker: The client will read environmental variables for your Synapse credentials. - - a. Create the file that contains the future environment variables - - .. code:: console - - cp .env.sample .env - - b. Update the configuration values in *.env*. Set the values of **SYNAPSE_USERNAME** - and **SYNAPSE_APIKEY** with the credentials of your Synapse account. - - c. Run docker command - - .. code:: console - - docker run --rm --env-file .env nlpsandbox/cli - -.. _data-node: https://github.com/nlpsandbox/data-node -.. _date-annotator-example: https://github.com/nlpsandbox/date-annotator-example -.. _Synapse client configuration: https://docs.synapse.org/articles/client_configuration.html - -Contributing -============ -Interested in contributing? **Awesome!** We follow the typical `GitHub workflow`_ -of forking a repo, creating a branch, and opening pull requests. For more -information on how you can add or propose a change, visit our `contributing guide`_. - -.. _Github workflow: https://guides.github.com/introduction/flow/ -.. _contributing guide: https://github.com/nlpsandbox/nlpsandbox-client/blob/develop/CONTRIBUTING.md diff --git a/docs/ResourceSource.md b/docs/ResourceSource.md index d633c07d..ac183704 100644 --- a/docs/ResourceSource.md +++ b/docs/ResourceSource.md @@ -6,6 +6,7 @@ An API resource source Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Full path of an API resource | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/ResponsePageMetadata.md b/docs/ResponsePageMetadata.md index cf02cb40..7a3a31a6 100644 --- a/docs/ResponsePageMetadata.md +++ b/docs/ResponsePageMetadata.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **total_results** | **int** | The total number of results in the result set | **offset** | [**PageOffset**](PageOffset.md) | | [optional] **limit** | [**PageLimit**](PageLimit.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/ResponsePageMetadataLinks.md b/docs/ResponsePageMetadataLinks.md index 72aa9d18..38efc29a 100644 --- a/docs/ResponsePageMetadataLinks.md +++ b/docs/ResponsePageMetadataLinks.md @@ -6,6 +6,7 @@ Links to navigate to different pages of results Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **next** | **str** | Link to the next page of results | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextAnnotation.md b/docs/TextAnnotation.md index c88bde2d..68d8f251 100644 --- a/docs/TextAnnotation.md +++ b/docs/TextAnnotation.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **length** | **int** | The length of the annotation | **text** | **str** | The string annotated | **confidence** | **float** | The confidence in the accuracy of the annotation | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextContactAnnotationAllOf.md b/docs/TextContactAnnotationAllOf.md index 00324f7c..676a459e 100644 --- a/docs/TextContactAnnotationAllOf.md +++ b/docs/TextContactAnnotationAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contact_type** | **str** | Type of contact information | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextContactAnnotationApi.md b/docs/TextContactAnnotationApi.md index cc294eca..8a5f53af 100644 --- a/docs/TextContactAnnotationApi.md +++ b/docs/TextContactAnnotationApi.md @@ -16,6 +16,7 @@ Return the contact annotations found in a clinical note ### Example + ```python import time import nlpsandbox @@ -76,6 +77,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/TextContactAnnotationRequest.md b/docs/TextContactAnnotationRequest.md index 7741011e..f584f83b 100644 --- a/docs/TextContactAnnotationRequest.md +++ b/docs/TextContactAnnotationRequest.md @@ -6,6 +6,7 @@ A request to annotate contacts in a clinical note Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextContactAnnotationResponse.md b/docs/TextContactAnnotationResponse.md index 1fae20bd..13aa9f20 100644 --- a/docs/TextContactAnnotationResponse.md +++ b/docs/TextContactAnnotationResponse.md @@ -6,6 +6,7 @@ The response to a contact annotation request Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text_contact_annotations** | [**[TextContactAnnotation]**](TextContactAnnotation.md) | A list of contact annotations | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextCovidSymptomAnnotationAllOf.md b/docs/TextCovidSymptomAnnotationAllOf.md index 6db11090..9d008bfb 100644 --- a/docs/TextCovidSymptomAnnotationAllOf.md +++ b/docs/TextCovidSymptomAnnotationAllOf.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **condition** | **str** | The sign/symptom type according to CDC definition | **certainty** | **str** | Whether the annotation is positively or negatively correlated with the presence of COVID | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextCovidSymptomAnnotationApi.md b/docs/TextCovidSymptomAnnotationApi.md index 093480d2..384f7a78 100644 --- a/docs/TextCovidSymptomAnnotationApi.md +++ b/docs/TextCovidSymptomAnnotationApi.md @@ -16,6 +16,7 @@ Return the COVID symptom annotations found in a clinical note ### Example + ```python import time import nlpsandbox @@ -76,6 +77,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/TextCovidSymptomAnnotationRequest.md b/docs/TextCovidSymptomAnnotationRequest.md index cdf9f402..273e6674 100644 --- a/docs/TextCovidSymptomAnnotationRequest.md +++ b/docs/TextCovidSymptomAnnotationRequest.md @@ -6,6 +6,7 @@ A request to annotate COVID symptoms in a clinical note Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextCovidSymptomAnnotationResponse.md b/docs/TextCovidSymptomAnnotationResponse.md index 42295a3e..7717da38 100644 --- a/docs/TextCovidSymptomAnnotationResponse.md +++ b/docs/TextCovidSymptomAnnotationResponse.md @@ -6,6 +6,7 @@ The response to a COVID symptoms annotation request Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text_covid_symptom_annotations** | [**[TextCovidSymptomAnnotation]**](TextCovidSymptomAnnotation.md) | A list of COVID symptom annotations | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextDateAnnotationAllOf.md b/docs/TextDateAnnotationAllOf.md index c2706e21..d8263dd6 100644 --- a/docs/TextDateAnnotationAllOf.md +++ b/docs/TextDateAnnotationAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **date_format** | **str** | Date format (ISO 8601) | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextDateAnnotationApi.md b/docs/TextDateAnnotationApi.md index 422330a4..535a869d 100644 --- a/docs/TextDateAnnotationApi.md +++ b/docs/TextDateAnnotationApi.md @@ -16,6 +16,7 @@ Return the date annotations found in a clinical note ### Example + ```python import time import nlpsandbox @@ -76,6 +77,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/TextDateAnnotationRequest.md b/docs/TextDateAnnotationRequest.md index 60cec3b3..8e913227 100644 --- a/docs/TextDateAnnotationRequest.md +++ b/docs/TextDateAnnotationRequest.md @@ -6,6 +6,7 @@ A request to annotate dates in a clinical note Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextDateAnnotationResponse.md b/docs/TextDateAnnotationResponse.md index ee2f727b..f8b0ab14 100644 --- a/docs/TextDateAnnotationResponse.md +++ b/docs/TextDateAnnotationResponse.md @@ -6,6 +6,7 @@ The response to a dates annotation request Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text_date_annotations** | [**[TextDateAnnotation]**](TextDateAnnotation.md) | A list of date annotations | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextDateAnnotations.md b/docs/TextDateAnnotations.md deleted file mode 100644 index deef6227..00000000 --- a/docs/TextDateAnnotations.md +++ /dev/null @@ -1,11 +0,0 @@ -# TextDateAnnotations - -A list of text date annotations -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text_date_annotations** | [**[TextDateAnnotation]**](TextDateAnnotation.md) | A list of text date annotations | [optional] - -[[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/TextIdAnnotationAllOf.md b/docs/TextIdAnnotationAllOf.md index 29b85633..13102d92 100644 --- a/docs/TextIdAnnotationAllOf.md +++ b/docs/TextIdAnnotationAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id_type** | **str** | Type of ID information | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextIdAnnotationApi.md b/docs/TextIdAnnotationApi.md index 1c886bb5..7536bf6f 100644 --- a/docs/TextIdAnnotationApi.md +++ b/docs/TextIdAnnotationApi.md @@ -16,6 +16,7 @@ Return the ID annotations found in a clinical note ### Example + ```python import time import nlpsandbox @@ -76,6 +77,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/TextIdAnnotationRequest.md b/docs/TextIdAnnotationRequest.md index 90bd3668..28167d15 100644 --- a/docs/TextIdAnnotationRequest.md +++ b/docs/TextIdAnnotationRequest.md @@ -6,6 +6,7 @@ A request to annotate IDs in a clinical note Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextIdAnnotationResponse.md b/docs/TextIdAnnotationResponse.md index b602eafe..94712fe9 100644 --- a/docs/TextIdAnnotationResponse.md +++ b/docs/TextIdAnnotationResponse.md @@ -6,6 +6,7 @@ The response to an ID annotation request Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text_id_annotations** | [**[TextIdAnnotation]**](TextIdAnnotation.md) | A list of ID annotations | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextPhysicalAddressAnnotation.md b/docs/TextLocationAnnotation.md similarity index 83% rename from docs/TextPhysicalAddressAnnotation.md rename to docs/TextLocationAnnotation.md index 23150650..c9c73df7 100644 --- a/docs/TextPhysicalAddressAnnotation.md +++ b/docs/TextLocationAnnotation.md @@ -1,6 +1,6 @@ -# TextPhysicalAddressAnnotation +# TextLocationAnnotation -A physical address annotation in a text +A location annotation in a text ## Properties Name | Type | Description | Notes @@ -9,7 +9,7 @@ Name | Type | Description | Notes **length** | **int** | The length of the annotation | **text** | **str** | The string annotated | **confidence** | **float** | The confidence in the accuracy of the annotation | -**address_type** | **str** | Type of address information | +**location_type** | **str** | Type of location | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextPhysicalAddressAnnotationAllOf.md b/docs/TextLocationAnnotationAllOf.md similarity index 52% rename from docs/TextPhysicalAddressAnnotationAllOf.md rename to docs/TextLocationAnnotationAllOf.md index 0e07ae59..49648804 100644 --- a/docs/TextPhysicalAddressAnnotationAllOf.md +++ b/docs/TextLocationAnnotationAllOf.md @@ -1,10 +1,11 @@ -# TextPhysicalAddressAnnotationAllOf +# TextLocationAnnotationAllOf ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**address_type** | **str** | Type of address information | +**location_type** | **str** | Type of location | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextPhysicalAddressAnnotationApi.md b/docs/TextLocationAnnotationApi.md similarity index 52% rename from docs/TextPhysicalAddressAnnotationApi.md rename to docs/TextLocationAnnotationApi.md index 2cab01ae..1c5c5e83 100644 --- a/docs/TextPhysicalAddressAnnotationApi.md +++ b/docs/TextLocationAnnotationApi.md @@ -1,28 +1,29 @@ -# nlpsandbox.TextPhysicalAddressAnnotationApi +# nlpsandbox.TextLocationAnnotationApi All URIs are relative to *http://example.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**create_text_physical_address_annotations**](TextPhysicalAddressAnnotationApi.md#create_text_physical_address_annotations) | **POST** /textPhysicalAddressAnnotations | Annotate physical addresses in a clinical note +[**create_text_location_annotations**](TextLocationAnnotationApi.md#create_text_location_annotations) | **POST** /textLocationAnnotations | Annotate locations in a clinical note -# **create_text_physical_address_annotations** -> TextPhysicalAddressAnnotationResponse create_text_physical_address_annotations() +# **create_text_location_annotations** +> TextLocationAnnotationResponse create_text_location_annotations() -Annotate physical addresses in a clinical note +Annotate locations in a clinical note -Return the physical addresse annotations found in a clinical note +Return the location annotations found in a clinical note ### Example + ```python import time import nlpsandbox -from nlpsandbox.api import text_physical_address_annotation_api +from nlpsandbox.api import text_location_annotation_api +from nlpsandbox.model.text_location_annotation_response import TextLocationAnnotationResponse from nlpsandbox.model.error import Error -from nlpsandbox.model.text_physical_address_annotation_response import TextPhysicalAddressAnnotationResponse -from nlpsandbox.model.text_physical_address_annotation_request import TextPhysicalAddressAnnotationRequest +from nlpsandbox.model.text_location_annotation_request import TextLocationAnnotationRequest from pprint import pprint # Defining the host is optional and defaults to http://example.com/api/v1 # See configuration.py for a list of all supported configuration parameters. @@ -34,24 +35,24 @@ configuration = nlpsandbox.Configuration( # Enter a context with an instance of the API client with nlpsandbox.ApiClient() as api_client: # Create an instance of the API class - api_instance = text_physical_address_annotation_api.TextPhysicalAddressAnnotationApi(api_client) - text_physical_address_annotation_request = TextPhysicalAddressAnnotationRequest( + api_instance = text_location_annotation_api.TextLocationAnnotationApi(api_client) + text_location_annotation_request = TextLocationAnnotationRequest( note=Note( identifier=NoteId("awesome-note"), text="text_example", type="type_example", patient_id=PatientId("awesome-patient"), ), - ) # TextPhysicalAddressAnnotationRequest | (optional) + ) # TextLocationAnnotationRequest | (optional) # example passing only required values which don't have defaults set # and optional values try: - # Annotate physical addresses in a clinical note - api_response = api_instance.create_text_physical_address_annotations(text_physical_address_annotation_request=text_physical_address_annotation_request) + # Annotate locations in a clinical note + api_response = api_instance.create_text_location_annotations(text_location_annotation_request=text_location_annotation_request) pprint(api_response) except nlpsandbox.ApiException as e: - print("Exception when calling TextPhysicalAddressAnnotationApi->create_text_physical_address_annotations: %s\n" % e) + print("Exception when calling TextLocationAnnotationApi->create_text_location_annotations: %s\n" % e) ``` @@ -59,11 +60,11 @@ with nlpsandbox.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **text_physical_address_annotation_request** | [**TextPhysicalAddressAnnotationRequest**](TextPhysicalAddressAnnotationRequest.md)| | [optional] + **text_location_annotation_request** | [**TextLocationAnnotationRequest**](TextLocationAnnotationRequest.md)| | [optional] ### Return type -[**TextPhysicalAddressAnnotationResponse**](TextPhysicalAddressAnnotationResponse.md) +[**TextLocationAnnotationResponse**](TextLocationAnnotationResponse.md) ### Authorization @@ -76,6 +77,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/TextPhysicalAddressAnnotationRequest.md b/docs/TextLocationAnnotationRequest.md similarity index 55% rename from docs/TextPhysicalAddressAnnotationRequest.md rename to docs/TextLocationAnnotationRequest.md index 65f18655..9e6586e0 100644 --- a/docs/TextPhysicalAddressAnnotationRequest.md +++ b/docs/TextLocationAnnotationRequest.md @@ -1,11 +1,12 @@ -# TextPhysicalAddressAnnotationRequest +# TextLocationAnnotationRequest -A request to annotate physical addresses in a clinical note +A request to annotate locations in a clinical note ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextLocationAnnotationResponse.md b/docs/TextLocationAnnotationResponse.md new file mode 100644 index 00000000..a6feff2a --- /dev/null +++ b/docs/TextLocationAnnotationResponse.md @@ -0,0 +1,13 @@ +# TextLocationAnnotationResponse + +The response to a locations annotation request + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**text_location_annotations** | [**[TextLocationAnnotation]**](TextLocationAnnotation.md) | A list of location annotations | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[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/TextPersonNameAnnotationApi.md b/docs/TextPersonNameAnnotationApi.md index e4948de5..e89c41de 100644 --- a/docs/TextPersonNameAnnotationApi.md +++ b/docs/TextPersonNameAnnotationApi.md @@ -16,6 +16,7 @@ Return the person name annotations found in a clinical note ### Example + ```python import time import nlpsandbox @@ -76,6 +77,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/TextPersonNameAnnotationRequest.md b/docs/TextPersonNameAnnotationRequest.md index 599354ba..a561b57b 100644 --- a/docs/TextPersonNameAnnotationRequest.md +++ b/docs/TextPersonNameAnnotationRequest.md @@ -6,6 +6,7 @@ A request to annotate person names in a clinical note Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **note** | [**Note**](Note.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextPersonNameAnnotationResponse.md b/docs/TextPersonNameAnnotationResponse.md index 2805737d..c05b217b 100644 --- a/docs/TextPersonNameAnnotationResponse.md +++ b/docs/TextPersonNameAnnotationResponse.md @@ -6,6 +6,7 @@ The response to a person names annotation request Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text_person_name_annotations** | [**[TextPersonNameAnnotation]**](TextPersonNameAnnotation.md) | A list of person name annotations | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/TextPersonNameAnnotations.md b/docs/TextPersonNameAnnotations.md deleted file mode 100644 index 0eeea69f..00000000 --- a/docs/TextPersonNameAnnotations.md +++ /dev/null @@ -1,11 +0,0 @@ -# TextPersonNameAnnotations - -A list of text person name annotations -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text_person_name_annotations** | [**[TextPersonNameAnnotation]**](TextPersonNameAnnotation.md) | A list of text person name annotations | [optional] - -[[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/TextPhysicalAddressAnnotationResponse.md b/docs/TextPhysicalAddressAnnotationResponse.md deleted file mode 100644 index 7a041137..00000000 --- a/docs/TextPhysicalAddressAnnotationResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# TextPhysicalAddressAnnotationResponse - -The response to a physical addresses annotation request - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text_physical_address_annotations** | [**[TextPhysicalAddressAnnotation]**](TextPhysicalAddressAnnotation.md) | A list of physical address annotations | - -[[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/TextPhysicalAddressAnnotations.md b/docs/TextPhysicalAddressAnnotations.md deleted file mode 100644 index 0417fcae..00000000 --- a/docs/TextPhysicalAddressAnnotations.md +++ /dev/null @@ -1,11 +0,0 @@ -# TextPhysicalAddressAnnotations - -A list of text physical address annotations -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text_physical_address_annotations** | [**[TextPhysicalAddressAnnotation]**](TextPhysicalAddressAnnotation.md) | A list of text physical address annotations | [optional] - -[[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/Tool.md b/docs/Tool.md index ec66da53..728b37b9 100644 --- a/docs/Tool.md +++ b/docs/Tool.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **url** | **str** | The URL to the homepage of the tool | **type** | [**ToolType**](ToolType.md) | | **api_version** | **str** | The version of the tool OpenAPI specification | +**programming_languages** | [**[ProgrammingLanguage]**](ProgrammingLanguage.md) | The programming languages used to develop this tool | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/ToolApi.md b/docs/ToolApi.md index 1fb5d7e7..0c4ceeb1 100644 --- a/docs/ToolApi.md +++ b/docs/ToolApi.md @@ -17,6 +17,7 @@ Get information about the tool ### Example + ```python import time import nlpsandbox @@ -64,6 +65,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | @@ -81,6 +83,7 @@ Get the dependencies of this tool ### Example + ```python import time import nlpsandbox @@ -128,6 +131,7 @@ No authorization required ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Success | - | diff --git a/docs/ToolDependencies.md b/docs/ToolDependencies.md index c8492b67..35bb39cd 100644 --- a/docs/ToolDependencies.md +++ b/docs/ToolDependencies.md @@ -6,6 +6,7 @@ A list of tool dependencies Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tools** | [**[Tool]**](Tool.md) | A list of tools | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] [[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/ToolType.md b/docs/ToolType.md index 3105c04d..a457b4c7 100644 --- a/docs/ToolType.md +++ b/docs/ToolType.md @@ -5,7 +5,7 @@ The type of this tool ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | **str** | The type of this tool | +**value** | **str** | The type of this tool | must be one of ["nlpsandbox:contact-annotator", "nlpsandbox:covid-symptom-annotator", "nlpsandbox:data-node", "nlpsandbox:date-annotator", "nlpsandbox:id-annotator", "nlpsandbox:location-annotator", "nlpsandbox:person-name-annotator", "nlpsandbox:phi-annotator", "nlpsandbox:phi-deidentifier", ] [[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/about/authors.rst b/docs/about/authors.rst deleted file mode 100644 index a2fae277..00000000 --- a/docs/about/authors.rst +++ /dev/null @@ -1,13 +0,0 @@ -******* -Authors -******* - -- `Thomas Yu`_ -- `Thomas Schaffter`_ - - -If you would like to help make **nlpsandboxclient** better, either through -code, documentation, tests, or bug reports, don't hesitate to do so! - -.. _Thomas Yu: https://github.com/thomasyu888 -.. _Thomas Schaffter: https://github.com/tschaffter diff --git a/docs/about/changelog.rst b/docs/about/changelog.rst deleted file mode 100644 index b516d9f2..00000000 --- a/docs/about/changelog.rst +++ /dev/null @@ -1,27 +0,0 @@ -********* -Changelog -********* - -This changelog is used to track all major changes to **nlpsandboxclient**. - -For older releases, visit the `GitHub releases`_. - -.. _Github releases: https://github.com/nlpsandbox/nlpsandbox-client/releases - -v1.0.0 ------- -- Client uses NLP sandbox API version 1.0.2 -- Update annotate note to accept `Note` instead of `TextAnnotatorRequest` object -- Update client to support v1.0.2 schemas -- Change `date`, `person`, `address` to `nlpsandbox:date-annotator`, `nlpsandbox:person-name-annotator` and `nlpsandbox:physical-address-annotator` -- Add support for `Python` 3.9 -- Add initial unit tests -- Create `tool` and `datanode` cli modules - -v0.4.1 ------- -- Client uses NLP sandbox API version 1.0.1 - -v0.3.1 ------- -- Client uses NLP sandbox API version 1.0.0 diff --git a/docs/cli/nlp-cli.rst b/docs/cli/nlp-cli.rst deleted file mode 100644 index feb2641b..00000000 --- a/docs/cli/nlp-cli.rst +++ /dev/null @@ -1,25 +0,0 @@ -******* -nlp-cli -******* - -This is the NLP sandbox command line client. - -.. click:: nlpsandboxclient.cli.__main__:cli - :prog: nlp-cli - :nested: full - -.. click:: nlpsandboxclient.cli.community:cli - :prog: nlp-cli community - :nested: full - -.. click:: nlpsandboxclient.cli.evaluate:evaluate_prediction - :prog: nlp-cli evaluate-prediction - :nested: full - -.. click:: nlpsandboxclient.cli.datanode_cli:cli - :prog: nlp-cli datanode - :nested: full - -.. click:: nlpsandboxclient.cli.tool:cli - :prog: nlp-cli tool - :nested: full diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index ac2c9405..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,189 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Configuration file for the Sphinx documentation builder. -# -# This file does only contain a selection of the most common options. For a -# full list see the documentation: -# http://www.sphinx-doc.org/en/master/config - -import os -import sys - -import sphinx_rtd_theme - -# -- Path setup -------------------------------------------------------------- - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('..')) - -# -- Project information ----------------------------------------------------- - -project = 'nlpsandboxclient' -copyright = '2020, Sage Bionetworks' -author = 'Thomas Yu' - -# The short X.Y version -version = '3.0' -# The full version, including alpha/beta/rc tags -release = version - -# -- General configuration --------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.doctest', - 'sphinx.ext.coverage', - 'sphinx.ext.viewcode', - 'sphinx.ext.githubpages', - 'sphinx.ext.napoleon', - 'sphinx_rtd_theme', - 'sphinx_click' -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'default' - - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -_ = [sphinx_rtd_theme] -html_theme = 'sphinx_rtd_theme' -# html_logo = '' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -html_theme_options = { - 'logo_only': False, - 'prev_next_buttons_location': None -} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -# html_static_path = ['static'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# The default sidebars (for documents that don't match any pattern) are -# defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. -# -# html_sidebars = {} - - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'nlpsandboxclientdoc' - - -# -- Options for LaTeX output ------------------------------------------------ - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'nlpsandboxclient.tex', 'nlpsandboxclient Documentation', - 'Thomas Yu', 'manual'), -] - - -# -- Options for manual page output ------------------------------------------ - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'nlpsandboxclient', 'nlpsandboxclient Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ---------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'nlpsandboxclient', 'nlpsandboxclient Documentation', - author, 'nlpsandboxclient', 'NLP sandbox helper functions.', - 'Miscellaneous'), -] - - -# -- Options for Epub output ------------------------------------------------- - -# Bibliographic Dublin Core info. -epub_title = project - -# The unique identifier of the text. This can be a ISBN number -# or the project homepage. -# -# epub_identifier = '' - -# A unique identification for the text. -# -# epub_uid = '' - -# A list of files that should not be packed into the epub file. -epub_exclude_files = ['search.html'] - - -# -- Extension configuration ------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst deleted file mode 100644 index 4185ba3b..00000000 --- a/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: README.rst - -.. toctree:: - :caption: Python Client - :maxdepth: 2 - - python/client - -.. toctree:: - :caption: Command-Line Client - :maxdepth: 2 - - cli/nlp-cli - -.. toctree:: - :caption: About - :maxdepth: 1 - - about/changelog - about/authors diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 27f573b8..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/docs/python/client.rst b/docs/python/client.rst deleted file mode 100644 index 81e275f8..00000000 --- a/docs/python/client.rst +++ /dev/null @@ -1,18 +0,0 @@ -**************** -nlpsandboxclient -**************** - -.. automodule:: nlpsandboxclient.client - :members: - :undoc-members: - :show-inheritance: - -.. automodule:: nlpsandboxclient.utils - :members: - :undoc-members: - :show-inheritance: - -.. automodule:: nlpsandboxclient.evaluation - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 93a9d33d..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pandas==1.0.1 -synapseclient==2.3.0 -nlpsandbox-client -sphinx_rtd_theme -sphinx-click \ No newline at end of file diff --git a/nlpsandbox/__init__.py b/nlpsandbox/__init__.py index 58a93ba4..51ceabe7 100644 --- a/nlpsandbox/__init__.py +++ b/nlpsandbox/__init__.py @@ -5,7 +5,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/nlpsandbox/api/annotation_api.py b/nlpsandbox/api/annotation_api.py index 3ad7ee45..edffcb4e 100644 --- a/nlpsandbox/api/annotation_api.py +++ b/nlpsandbox/api/annotation_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -46,86 +46,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_annotation( - self, - dataset_id, - annotation_store_id, - annotation_id, - **kwargs - ): - """Create an annotation # noqa: E501 - - Create an annotation # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_annotation(dataset_id, annotation_store_id, annotation_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (AnnotationStoreId): The ID of the annotation store - annotation_id (AnnotationId): The ID of the annotation that is being created - - Keyword Args: - annotation_create_request (AnnotationCreateRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnnotationCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - kwargs['annotation_id'] = \ - annotation_id - return self.call_with_http_info(**kwargs) - - self.create_annotation = _Endpoint( + self.create_annotation_endpoint = _Endpoint( settings={ 'response_type': (AnnotationCreateResponse,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations', 'operation_id': 'create_annotation', 'http_method': 'POST', @@ -187,88 +113,14 @@ def __create_annotation( 'application/json' ] }, - api_client=api_client, - callable=__create_annotation + api_client=api_client ) - - def __delete_annotation( - self, - dataset_id, - annotation_store_id, - annotation_id, - **kwargs - ): - """Delete an annotation # noqa: E501 - - Deletes the annotation specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_annotation(dataset_id, annotation_store_id, annotation_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (FhirStoreId): The ID of the annotation store - annotation_id (AnnotationId): The ID of the annotation - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - kwargs['annotation_id'] = \ - annotation_id - return self.call_with_http_info(**kwargs) - - self.delete_annotation = _Endpoint( + self.delete_annotation_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations/{annotationId}', 'operation_id': 'delete_annotation', 'http_method': 'DELETE', @@ -324,88 +176,14 @@ def __delete_annotation( ], 'content_type': [], }, - api_client=api_client, - callable=__delete_annotation + api_client=api_client ) - - def __get_annotation( - self, - dataset_id, - annotation_store_id, - annotation_id, - **kwargs - ): - """Get an annotation # noqa: E501 - - Returns the annotation specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_annotation(dataset_id, annotation_store_id, annotation_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (FhirStoreId): The ID of the annotation store - annotation_id (AnnotationId): The ID of the annotation - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Annotation - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - kwargs['annotation_id'] = \ - annotation_id - return self.call_with_http_info(**kwargs) - - self.get_annotation = _Endpoint( + self.get_annotation_endpoint = _Endpoint( settings={ 'response_type': (Annotation,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations/{annotationId}', 'operation_id': 'get_annotation', 'http_method': 'GET', @@ -461,86 +239,14 @@ def __get_annotation( ], 'content_type': [], }, - api_client=api_client, - callable=__get_annotation + api_client=api_client ) - - def __list_annotations( - self, - dataset_id, - annotation_store_id, - **kwargs - ): - """List the annotations in an annotation store # noqa: E501 - - Returns the annotations in an annotation store # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_annotations(dataset_id, annotation_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (AnnotationStoreId): The ID of the annotation store - - Keyword Args: - limit (PageLimit): Maximum number of results returned. [optional] - offset (PageOffset): Index of the first result that must be returned. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PageOfAnnotations - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - return self.call_with_http_info(**kwargs) - - self.list_annotations = _Endpoint( + self.list_annotations_endpoint = _Endpoint( settings={ 'response_type': (PageOfAnnotations,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations', 'operation_id': 'list_annotations', 'http_method': 'GET', @@ -600,6 +306,301 @@ def __list_annotations( ], 'content_type': [], }, - api_client=api_client, - callable=__list_annotations + api_client=api_client + ) + + def create_annotation( + self, + dataset_id, + annotation_store_id, + annotation_id, + **kwargs + ): + """Create an annotation # noqa: E501 + + Create an annotation # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_annotation(dataset_id, annotation_store_id, annotation_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (AnnotationStoreId): The ID of the annotation store + annotation_id (AnnotationId): The ID of the annotation that is being created + + Keyword Args: + annotation_create_request (AnnotationCreateRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnnotationCreateResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + kwargs['annotation_id'] = \ + annotation_id + return self.create_annotation_endpoint.call_with_http_info(**kwargs) + + def delete_annotation( + self, + dataset_id, + annotation_store_id, + annotation_id, + **kwargs + ): + """Delete an annotation # noqa: E501 + + Deletes the annotation specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_annotation(dataset_id, annotation_store_id, annotation_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (FhirStoreId): The ID of the annotation store + annotation_id (AnnotationId): The ID of the annotation + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + kwargs['annotation_id'] = \ + annotation_id + return self.delete_annotation_endpoint.call_with_http_info(**kwargs) + + def get_annotation( + self, + dataset_id, + annotation_store_id, + annotation_id, + **kwargs + ): + """Get an annotation # noqa: E501 + + Returns the annotation specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_annotation(dataset_id, annotation_store_id, annotation_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (FhirStoreId): The ID of the annotation store + annotation_id (AnnotationId): The ID of the annotation + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Annotation + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + kwargs['annotation_id'] = \ + annotation_id + return self.get_annotation_endpoint.call_with_http_info(**kwargs) + + def list_annotations( + self, + dataset_id, + annotation_store_id, + **kwargs + ): + """List the annotations in an annotation store # noqa: E501 + + Returns the annotations in an annotation store # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_annotations(dataset_id, annotation_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (AnnotationStoreId): The ID of the annotation store + + Keyword Args: + limit (PageLimit): Maximum number of results returned. [optional] + offset (PageOffset): Index of the first result that must be returned. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PageOfAnnotations + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + return self.list_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/annotation_store_api.py b/nlpsandbox/api/annotation_store_api.py index 057a4267..23ae0ad5 100644 --- a/nlpsandbox/api/annotation_store_api.py +++ b/nlpsandbox/api/annotation_store_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -43,82 +43,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_annotation_store( - self, - dataset_id, - annotation_store_id, - **kwargs - ): - """Create an annotation store # noqa: E501 - - Create an annotation store with the ID specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_annotation_store(dataset_id, annotation_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (AnnotationStoreId): The ID of the annotation store that is being created. - - Keyword Args: - body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnnotationStoreCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - return self.call_with_http_info(**kwargs) - - self.create_annotation_store = _Endpoint( + self.create_annotation_store_endpoint = _Endpoint( settings={ 'response_type': (AnnotationStoreCreateResponse,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores', 'operation_id': 'create_annotation_store', 'http_method': 'POST', @@ -174,84 +104,14 @@ def __create_annotation_store( 'application/json' ] }, - api_client=api_client, - callable=__create_annotation_store + api_client=api_client ) - - def __delete_annotation_store( - self, - dataset_id, - annotation_store_id, - **kwargs - ): - """Delete an annotation store # noqa: E501 - - Deletes the annotation store specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_annotation_store(dataset_id, annotation_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (AnnotationStoreId): The ID of the annotation store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - return self.call_with_http_info(**kwargs) - - self.delete_annotation_store = _Endpoint( + self.delete_annotation_store_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores/{annotationStoreId}', 'operation_id': 'delete_annotation_store', 'http_method': 'DELETE', @@ -301,84 +161,14 @@ def __delete_annotation_store( ], 'content_type': [], }, - api_client=api_client, - callable=__delete_annotation_store + api_client=api_client ) - - def __get_annotation_store( - self, - dataset_id, - annotation_store_id, - **kwargs - ): - """Get an annotation store # noqa: E501 - - Returns the annotation store specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_annotation_store(dataset_id, annotation_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - annotation_store_id (AnnotationStoreId): The ID of the annotation store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - AnnotationStore - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['annotation_store_id'] = \ - annotation_store_id - return self.call_with_http_info(**kwargs) - - self.get_annotation_store = _Endpoint( + self.get_annotation_store_endpoint = _Endpoint( settings={ 'response_type': (AnnotationStore,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores/{annotationStoreId}', 'operation_id': 'get_annotation_store', 'http_method': 'GET', @@ -428,82 +218,14 @@ def __get_annotation_store( ], 'content_type': [], }, - api_client=api_client, - callable=__get_annotation_store + api_client=api_client ) - - def __list_annotation_stores( - self, - dataset_id, - **kwargs - ): - """List the annotation stores in a dataset # noqa: E501 - - Returns the annotation stores # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_annotation_stores(dataset_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - - Keyword Args: - limit (PageLimit): Maximum number of results returned. [optional] - offset (PageOffset): Index of the first result that must be returned. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PageOfAnnotationStores - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - return self.call_with_http_info(**kwargs) - - self.list_annotation_stores = _Endpoint( + self.list_annotation_stores_endpoint = _Endpoint( settings={ 'response_type': (PageOfAnnotationStores,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/annotationStores', 'operation_id': 'list_annotation_stores', 'http_method': 'GET', @@ -557,6 +279,285 @@ def __list_annotation_stores( ], 'content_type': [], }, - api_client=api_client, - callable=__list_annotation_stores + api_client=api_client + ) + + def create_annotation_store( + self, + dataset_id, + annotation_store_id, + **kwargs + ): + """Create an annotation store # noqa: E501 + + Create an annotation store with the ID specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_annotation_store(dataset_id, annotation_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (AnnotationStoreId): The ID of the annotation store that is being created. + + Keyword Args: + body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnnotationStoreCreateResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + return self.create_annotation_store_endpoint.call_with_http_info(**kwargs) + + def delete_annotation_store( + self, + dataset_id, + annotation_store_id, + **kwargs + ): + """Delete an annotation store # noqa: E501 + + Deletes the annotation store specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_annotation_store(dataset_id, annotation_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (AnnotationStoreId): The ID of the annotation store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + return self.delete_annotation_store_endpoint.call_with_http_info(**kwargs) + + def get_annotation_store( + self, + dataset_id, + annotation_store_id, + **kwargs + ): + """Get an annotation store # noqa: E501 + + Returns the annotation store specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_annotation_store(dataset_id, annotation_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + annotation_store_id (AnnotationStoreId): The ID of the annotation store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + AnnotationStore + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['annotation_store_id'] = \ + annotation_store_id + return self.get_annotation_store_endpoint.call_with_http_info(**kwargs) + + def list_annotation_stores( + self, + dataset_id, + **kwargs + ): + """List the annotation stores in a dataset # noqa: E501 + + Returns the annotation stores # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_annotation_stores(dataset_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + + Keyword Args: + limit (PageLimit): Maximum number of results returned. [optional] + offset (PageOffset): Index of the first result that must be returned. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PageOfAnnotationStores + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + return self.list_annotation_stores_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/dataset_api.py b/nlpsandbox/api/dataset_api.py index 7dabc63b..7e4d3fa2 100644 --- a/nlpsandbox/api/dataset_api.py +++ b/nlpsandbox/api/dataset_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -42,78 +42,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_dataset( - self, - dataset_id, - **kwargs - ): - """Create a dataset # noqa: E501 - - Create a dataset with the name specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_dataset(dataset_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset that is being created - - Keyword Args: - body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - DatasetCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - return self.call_with_http_info(**kwargs) - - self.create_dataset = _Endpoint( + self.create_dataset_endpoint = _Endpoint( settings={ 'response_type': (DatasetCreateResponse,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets', 'operation_id': 'create_dataset', 'http_method': 'POST', @@ -163,80 +97,14 @@ def __create_dataset( 'application/json' ] }, - api_client=api_client, - callable=__create_dataset + api_client=api_client ) - - def __delete_dataset( - self, - dataset_id, - **kwargs - ): - """Delete a dataset by ID # noqa: E501 - - Deletes the dataset for a given 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.delete_dataset(dataset_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - return self.call_with_http_info(**kwargs) - - self.delete_dataset = _Endpoint( + self.delete_dataset_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}', 'operation_id': 'delete_dataset', 'http_method': 'DELETE', @@ -280,80 +148,14 @@ def __delete_dataset( ], 'content_type': [], }, - api_client=api_client, - callable=__delete_dataset + api_client=api_client ) - - def __get_dataset( - self, - dataset_id, - **kwargs - ): - """Get a dataset by ID # noqa: E501 - - Returns the dataset for a given 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.get_dataset(dataset_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Dataset - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - return self.call_with_http_info(**kwargs) - - self.get_dataset = _Endpoint( + self.get_dataset_endpoint = _Endpoint( settings={ 'response_type': (Dataset,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}', 'operation_id': 'get_dataset', 'http_method': 'GET', @@ -397,77 +199,14 @@ def __get_dataset( ], 'content_type': [], }, - api_client=api_client, - callable=__get_dataset + api_client=api_client ) - - def __list_datasets( - self, - **kwargs - ): - """Get all datasets # noqa: E501 - - Returns the datasets # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_datasets(async_req=True) - >>> result = thread.get() - - - Keyword Args: - limit (PageLimit): Maximum number of results returned. [optional] - offset (PageOffset): Index of the first result that must be returned. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PageOfDatasets - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.list_datasets = _Endpoint( + self.list_datasets_endpoint = _Endpoint( settings={ 'response_type': (PageOfDatasets,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets', 'operation_id': 'list_datasets', 'http_method': 'GET', @@ -514,6 +253,268 @@ def __list_datasets( ], 'content_type': [], }, - api_client=api_client, - callable=__list_datasets + api_client=api_client + ) + + def create_dataset( + self, + dataset_id, + **kwargs + ): + """Create a dataset # noqa: E501 + + Create a dataset with the name specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_dataset(dataset_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset that is being created + + Keyword Args: + body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + DatasetCreateResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + return self.create_dataset_endpoint.call_with_http_info(**kwargs) + + def delete_dataset( + self, + dataset_id, + **kwargs + ): + """Delete a dataset by ID # noqa: E501 + + Deletes the dataset for a given 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.delete_dataset(dataset_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + return self.delete_dataset_endpoint.call_with_http_info(**kwargs) + + def get_dataset( + self, + dataset_id, + **kwargs + ): + """Get a dataset by ID # noqa: E501 + + Returns the dataset for a given 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.get_dataset(dataset_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Dataset + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + return self.get_dataset_endpoint.call_with_http_info(**kwargs) + + def list_datasets( + self, + **kwargs + ): + """Get all datasets # noqa: E501 + + Returns the datasets # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_datasets(async_req=True) + >>> result = thread.get() + + + Keyword Args: + limit (PageLimit): Maximum number of results returned. [optional] + offset (PageOffset): Index of the first result that must be returned. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PageOfDatasets + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.list_datasets_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/deidentified_note_api.py b/nlpsandbox/api/deidentified_note_api.py index 293f1d24..43267c06 100644 --- a/nlpsandbox/api/deidentified_note_api.py +++ b/nlpsandbox/api/deidentified_note_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,70 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_deidentified_notes( - self, - **kwargs - ): - """Deidentify a clinical note # noqa: E501 - - Returns the deidentified note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_deidentified_notes(async_req=True) - >>> result = thread.get() - - - Keyword Args: - deidentify_request (DeidentifyRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - DeidentifyResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_deidentified_notes = _Endpoint( + self.create_deidentified_notes_endpoint = _Endpoint( settings={ 'response_type': (DeidentifyResponse,), 'auth': [], @@ -147,6 +84,68 @@ def __create_deidentified_notes( 'application/json' ] }, - api_client=api_client, - callable=__create_deidentified_notes + api_client=api_client + ) + + def create_deidentified_notes( + self, + **kwargs + ): + """Deidentify a clinical note # noqa: E501 + + Returns the deidentified note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_deidentified_notes(async_req=True) + >>> result = thread.get() + + + Keyword Args: + deidentify_request (DeidentifyRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + DeidentifyResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_deidentified_notes_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/fhir_store_api.py b/nlpsandbox/api/fhir_store_api.py index af5f7bcc..3210d136 100644 --- a/nlpsandbox/api/fhir_store_api.py +++ b/nlpsandbox/api/fhir_store_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -43,82 +43,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_fhir_store( - self, - dataset_id, - fhir_store_id, - **kwargs - ): - """Create a FHIR store # noqa: E501 - - Create a FHIR store with the ID specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_fhir_store(dataset_id, fhir_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store that is being created. - - Keyword Args: - body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FhirStoreCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - return self.call_with_http_info(**kwargs) - - self.create_fhir_store = _Endpoint( + self.create_fhir_store_endpoint = _Endpoint( settings={ 'response_type': (FhirStoreCreateResponse,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores', 'operation_id': 'create_fhir_store', 'http_method': 'POST', @@ -174,84 +104,14 @@ def __create_fhir_store( 'application/json' ] }, - api_client=api_client, - callable=__create_fhir_store + api_client=api_client ) - - def __delete_fhir_store( - self, - dataset_id, - fhir_store_id, - **kwargs - ): - """Delete a FHIR store # noqa: E501 - - Deletes the FHIR store specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_fhir_store(dataset_id, fhir_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - return self.call_with_http_info(**kwargs) - - self.delete_fhir_store = _Endpoint( + self.delete_fhir_store_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}', 'operation_id': 'delete_fhir_store', 'http_method': 'DELETE', @@ -301,84 +161,14 @@ def __delete_fhir_store( ], 'content_type': [], }, - api_client=api_client, - callable=__delete_fhir_store + api_client=api_client ) - - def __get_fhir_store( - self, - dataset_id, - fhir_store_id, - **kwargs - ): - """Get a FHIR store # noqa: E501 - - Returns the FHIR store specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_fhir_store(dataset_id, fhir_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - FhirStore - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - return self.call_with_http_info(**kwargs) - - self.get_fhir_store = _Endpoint( + self.get_fhir_store_endpoint = _Endpoint( settings={ 'response_type': (FhirStore,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}', 'operation_id': 'get_fhir_store', 'http_method': 'GET', @@ -428,82 +218,14 @@ def __get_fhir_store( ], 'content_type': [], }, - api_client=api_client, - callable=__get_fhir_store + api_client=api_client ) - - def __list_fhir_stores( - self, - dataset_id, - **kwargs - ): - """List the FHIR stores in a dataset # noqa: E501 - - Returns the FHIR stores # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_fhir_stores(dataset_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - - Keyword Args: - limit (PageLimit): Maximum number of results returned. [optional] - offset (PageOffset): Index of the first result that must be returned. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PageOfFhirStores - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - return self.call_with_http_info(**kwargs) - - self.list_fhir_stores = _Endpoint( + self.list_fhir_stores_endpoint = _Endpoint( settings={ 'response_type': (PageOfFhirStores,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores', 'operation_id': 'list_fhir_stores', 'http_method': 'GET', @@ -557,6 +279,285 @@ def __list_fhir_stores( ], 'content_type': [], }, - api_client=api_client, - callable=__list_fhir_stores + api_client=api_client + ) + + def create_fhir_store( + self, + dataset_id, + fhir_store_id, + **kwargs + ): + """Create a FHIR store # noqa: E501 + + Create a FHIR store with the ID specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_fhir_store(dataset_id, fhir_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store that is being created. + + Keyword Args: + body ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + FhirStoreCreateResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + return self.create_fhir_store_endpoint.call_with_http_info(**kwargs) + + def delete_fhir_store( + self, + dataset_id, + fhir_store_id, + **kwargs + ): + """Delete a FHIR store # noqa: E501 + + Deletes the FHIR store specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_fhir_store(dataset_id, fhir_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + return self.delete_fhir_store_endpoint.call_with_http_info(**kwargs) + + def get_fhir_store( + self, + dataset_id, + fhir_store_id, + **kwargs + ): + """Get a FHIR store # noqa: E501 + + Returns the FHIR store specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_fhir_store(dataset_id, fhir_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + FhirStore + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + return self.get_fhir_store_endpoint.call_with_http_info(**kwargs) + + def list_fhir_stores( + self, + dataset_id, + **kwargs + ): + """List the FHIR stores in a dataset # noqa: E501 + + Returns the FHIR stores # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_fhir_stores(dataset_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + + Keyword Args: + limit (PageLimit): Maximum number of results returned. [optional] + offset (PageOffset): Index of the first result that must be returned. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PageOfFhirStores + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + return self.list_fhir_stores_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/health_check_api.py b/nlpsandbox/api/health_check_api.py index c7e34263..ea4668b5 100644 --- a/nlpsandbox/api/health_check_api.py +++ b/nlpsandbox/api/health_check_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -37,69 +37,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __get_health_check( - self, - **kwargs - ): - """Get health check information # noqa: E501 - - Get information about the health of the service # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_health_check(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - HealthCheck - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.get_health_check = _Endpoint( + self.get_health_check_endpoint = _Endpoint( settings={ 'response_type': (HealthCheck,), 'auth': [], @@ -139,6 +77,67 @@ def __get_health_check( ], 'content_type': [], }, - api_client=api_client, - callable=__get_health_check + api_client=api_client + ) + + def get_health_check( + self, + **kwargs + ): + """Get health check information # noqa: E501 + + Get information about the health of the service # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_health_check(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + HealthCheck + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_health_check_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/note_api.py b/nlpsandbox/api/note_api.py index 7a1193f1..5ade5869 100644 --- a/nlpsandbox/api/note_api.py +++ b/nlpsandbox/api/note_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -45,86 +45,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_note( - self, - dataset_id, - fhir_store_id, - note_id, - **kwargs - ): - """Create a note # noqa: E501 - - Create a note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_note(dataset_id, fhir_store_id, note_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - note_id (NoteId): The ID of the note that is being created - - Keyword Args: - note_create_request (NoteCreateRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - NoteCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - kwargs['note_id'] = \ - note_id - return self.call_with_http_info(**kwargs) - - self.create_note = _Endpoint( + self.create_note_endpoint = _Endpoint( settings={ 'response_type': (NoteCreateResponse,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Note', 'operation_id': 'create_note', 'http_method': 'POST', @@ -186,88 +112,14 @@ def __create_note( 'application/json' ] }, - api_client=api_client, - callable=__create_note + api_client=api_client ) - - def __delete_note( - self, - dataset_id, - fhir_store_id, - note_id, - **kwargs - ): - """Delete a note # noqa: E501 - - Deletes the note specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_note(dataset_id, fhir_store_id, note_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - note_id (NoteId): The ID of the note - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - kwargs['note_id'] = \ - note_id - return self.call_with_http_info(**kwargs) - - self.delete_note = _Endpoint( + self.delete_note_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Note/{noteId}', 'operation_id': 'delete_note', 'http_method': 'DELETE', @@ -323,88 +175,14 @@ def __delete_note( ], 'content_type': [], }, - api_client=api_client, - callable=__delete_note + api_client=api_client ) - - def __get_note( - self, - dataset_id, - fhir_store_id, - note_id, - **kwargs - ): - """Get a note # noqa: E501 - - Returns the note specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_note(dataset_id, fhir_store_id, note_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - note_id (NoteId): The ID of the note - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Note - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - kwargs['note_id'] = \ - note_id - return self.call_with_http_info(**kwargs) - - self.get_note = _Endpoint( + self.get_note_endpoint = _Endpoint( settings={ 'response_type': (Note,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Note/{noteId}', 'operation_id': 'get_note', 'http_method': 'GET', @@ -460,86 +238,14 @@ def __get_note( ], 'content_type': [], }, - api_client=api_client, - callable=__get_note + api_client=api_client ) - - def __list_notes( - self, - dataset_id, - fhir_store_id, - **kwargs - ): - """List notes # noqa: E501 - - Returns the notes in a FHIR store # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_notes(dataset_id, fhir_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - - Keyword Args: - limit (PageLimit): Maximum number of results returned. [optional] - offset (PageOffset): Index of the first result that must be returned. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PageOfNotes - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - return self.call_with_http_info(**kwargs) - - self.list_notes = _Endpoint( + self.list_notes_endpoint = _Endpoint( settings={ 'response_type': (PageOfNotes,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Note', 'operation_id': 'list_notes', 'http_method': 'GET', @@ -599,6 +305,301 @@ def __list_notes( ], 'content_type': [], }, - api_client=api_client, - callable=__list_notes + api_client=api_client + ) + + def create_note( + self, + dataset_id, + fhir_store_id, + note_id, + **kwargs + ): + """Create a note # noqa: E501 + + Create a note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_note(dataset_id, fhir_store_id, note_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + note_id (NoteId): The ID of the note that is being created + + Keyword Args: + note_create_request (NoteCreateRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + NoteCreateResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + kwargs['note_id'] = \ + note_id + return self.create_note_endpoint.call_with_http_info(**kwargs) + + def delete_note( + self, + dataset_id, + fhir_store_id, + note_id, + **kwargs + ): + """Delete a note # noqa: E501 + + Deletes the note specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_note(dataset_id, fhir_store_id, note_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + note_id (NoteId): The ID of the note + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + kwargs['note_id'] = \ + note_id + return self.delete_note_endpoint.call_with_http_info(**kwargs) + + def get_note( + self, + dataset_id, + fhir_store_id, + note_id, + **kwargs + ): + """Get a note # noqa: E501 + + Returns the note specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_note(dataset_id, fhir_store_id, note_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + note_id (NoteId): The ID of the note + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Note + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + kwargs['note_id'] = \ + note_id + return self.get_note_endpoint.call_with_http_info(**kwargs) + + def list_notes( + self, + dataset_id, + fhir_store_id, + **kwargs + ): + """List notes # noqa: E501 + + Returns the notes in a FHIR store # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_notes(dataset_id, fhir_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + + Keyword Args: + limit (PageLimit): Maximum number of results returned. [optional] + offset (PageOffset): Index of the first result that must be returned. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PageOfNotes + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + return self.list_notes_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/patient_api.py b/nlpsandbox/api/patient_api.py index af88cfb5..2bff9980 100644 --- a/nlpsandbox/api/patient_api.py +++ b/nlpsandbox/api/patient_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -45,86 +45,12 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_patient( - self, - dataset_id, - fhir_store_id, - patient_id, - **kwargs - ): - """Create a FHIR patient # noqa: E501 - - Create a FHIR patient # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_patient(dataset_id, fhir_store_id, patient_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - patient_id (PatientId): The ID of the patient that is being created - - Keyword Args: - patient_create_request (PatientCreateRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PatientCreateResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - kwargs['patient_id'] = \ - patient_id - return self.call_with_http_info(**kwargs) - - self.create_patient = _Endpoint( + self.create_patient_endpoint = _Endpoint( settings={ 'response_type': (PatientCreateResponse,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Patient', 'operation_id': 'create_patient', 'http_method': 'POST', @@ -186,88 +112,14 @@ def __create_patient( 'application/json' ] }, - api_client=api_client, - callable=__create_patient + api_client=api_client ) - - def __delete_patient( - self, - dataset_id, - fhir_store_id, - patient_id, - **kwargs - ): - """Delete a FHIR patient # noqa: E501 - - Deletes the FHIR patient specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_patient(dataset_id, fhir_store_id, patient_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - patient_id (PatientId): The ID of the FHIR patient - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - {str: (bool, date, datetime, dict, float, int, list, str, none_type)} - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - kwargs['patient_id'] = \ - patient_id - return self.call_with_http_info(**kwargs) - - self.delete_patient = _Endpoint( + self.delete_patient_endpoint = _Endpoint( settings={ 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Patient/{patientId}', 'operation_id': 'delete_patient', 'http_method': 'DELETE', @@ -323,88 +175,14 @@ def __delete_patient( ], 'content_type': [], }, - api_client=api_client, - callable=__delete_patient + api_client=api_client ) - - def __get_patient( - self, - dataset_id, - fhir_store_id, - patient_id, - **kwargs - ): - """Get a FHIR patient # noqa: E501 - - Returns the FHIR patient specified # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_patient(dataset_id, fhir_store_id, patient_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - patient_id (PatientId): The ID of the FHIR patient - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Patient - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - kwargs['patient_id'] = \ - patient_id - return self.call_with_http_info(**kwargs) - - self.get_patient = _Endpoint( + self.get_patient_endpoint = _Endpoint( settings={ 'response_type': (Patient,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Patient/{patientId}', 'operation_id': 'get_patient', 'http_method': 'GET', @@ -460,86 +238,14 @@ def __get_patient( ], 'content_type': [], }, - api_client=api_client, - callable=__get_patient + api_client=api_client ) - - def __list_patients( - self, - dataset_id, - fhir_store_id, - **kwargs - ): - """List the Patients in a FHIR store # noqa: E501 - - Returns the Patients in a FHIR store # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_patients(dataset_id, fhir_store_id, async_req=True) - >>> result = thread.get() - - Args: - dataset_id (DatasetId): The ID of the dataset - fhir_store_id (FhirStoreId): The ID of the FHIR store - - Keyword Args: - limit (PageLimit): Maximum number of results returned. [optional] - offset (PageOffset): Index of the first result that must be returned. [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - PageOfPatients - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['dataset_id'] = \ - dataset_id - kwargs['fhir_store_id'] = \ - fhir_store_id - return self.call_with_http_info(**kwargs) - - self.list_patients = _Endpoint( + self.list_patients_endpoint = _Endpoint( settings={ 'response_type': (PageOfPatients,), - 'auth': [], + 'auth': [ + 'ApiKeyAuth' + ], 'endpoint_path': '/datasets/{datasetId}/fhirStores/{fhirStoreId}/fhir/Patient', 'operation_id': 'list_patients', 'http_method': 'GET', @@ -599,6 +305,301 @@ def __list_patients( ], 'content_type': [], }, - api_client=api_client, - callable=__list_patients + api_client=api_client + ) + + def create_patient( + self, + dataset_id, + fhir_store_id, + patient_id, + **kwargs + ): + """Create a FHIR patient # noqa: E501 + + Create a FHIR patient # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_patient(dataset_id, fhir_store_id, patient_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + patient_id (PatientId): The ID of the patient that is being created + + Keyword Args: + patient_create_request (PatientCreateRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PatientCreateResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + kwargs['patient_id'] = \ + patient_id + return self.create_patient_endpoint.call_with_http_info(**kwargs) + + def delete_patient( + self, + dataset_id, + fhir_store_id, + patient_id, + **kwargs + ): + """Delete a FHIR patient # noqa: E501 + + Deletes the FHIR patient specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.delete_patient(dataset_id, fhir_store_id, patient_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + patient_id (PatientId): The ID of the FHIR patient + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + {str: (bool, date, datetime, dict, float, int, list, str, none_type)} + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + kwargs['patient_id'] = \ + patient_id + return self.delete_patient_endpoint.call_with_http_info(**kwargs) + + def get_patient( + self, + dataset_id, + fhir_store_id, + patient_id, + **kwargs + ): + """Get a FHIR patient # noqa: E501 + + Returns the FHIR patient specified # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_patient(dataset_id, fhir_store_id, patient_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + patient_id (PatientId): The ID of the FHIR patient + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Patient + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + kwargs['patient_id'] = \ + patient_id + return self.get_patient_endpoint.call_with_http_info(**kwargs) + + def list_patients( + self, + dataset_id, + fhir_store_id, + **kwargs + ): + """List the Patients in a FHIR store # noqa: E501 + + Returns the Patients in a FHIR store # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_patients(dataset_id, fhir_store_id, async_req=True) + >>> result = thread.get() + + Args: + dataset_id (DatasetId): The ID of the dataset + fhir_store_id (FhirStoreId): The ID of the FHIR store + + Keyword Args: + limit (PageLimit): Maximum number of results returned. [optional] + offset (PageOffset): Index of the first result that must be returned. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + PageOfPatients + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['dataset_id'] = \ + dataset_id + kwargs['fhir_store_id'] = \ + fhir_store_id + return self.list_patients_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_contact_annotation_api.py b/nlpsandbox/api/text_contact_annotation_api.py index 0833a977..f40866cf 100644 --- a/nlpsandbox/api/text_contact_annotation_api.py +++ b/nlpsandbox/api/text_contact_annotation_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,70 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_text_contact_annotations( - self, - **kwargs - ): - """Annotate contact information in a clinical note # noqa: E501 - - Return the contact annotations found in a clinical note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_text_contact_annotations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - text_contact_annotation_request (TextContactAnnotationRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TextContactAnnotationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_text_contact_annotations = _Endpoint( + self.create_text_contact_annotations_endpoint = _Endpoint( settings={ 'response_type': (TextContactAnnotationResponse,), 'auth': [], @@ -147,6 +84,68 @@ def __create_text_contact_annotations( 'application/json' ] }, - api_client=api_client, - callable=__create_text_contact_annotations + api_client=api_client + ) + + def create_text_contact_annotations( + self, + **kwargs + ): + """Annotate contact information in a clinical note # noqa: E501 + + Return the contact annotations found in a clinical note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_text_contact_annotations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + text_contact_annotation_request (TextContactAnnotationRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TextContactAnnotationResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_text_contact_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_covid_symptom_annotation_api.py b/nlpsandbox/api/text_covid_symptom_annotation_api.py index a1eb56b7..219c4cf5 100644 --- a/nlpsandbox/api/text_covid_symptom_annotation_api.py +++ b/nlpsandbox/api/text_covid_symptom_annotation_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,70 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_text_covid_symptom_annotations( - self, - **kwargs - ): - """Annotate COVID symptoms in a clinical note # noqa: E501 - - Return the COVID symptom annotations found in a clinical note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_text_covid_symptom_annotations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - text_covid_symptom_annotation_request (TextCovidSymptomAnnotationRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TextCovidSymptomAnnotationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_text_covid_symptom_annotations = _Endpoint( + self.create_text_covid_symptom_annotations_endpoint = _Endpoint( settings={ 'response_type': (TextCovidSymptomAnnotationResponse,), 'auth': [], @@ -147,6 +84,68 @@ def __create_text_covid_symptom_annotations( 'application/json' ] }, - api_client=api_client, - callable=__create_text_covid_symptom_annotations + api_client=api_client + ) + + def create_text_covid_symptom_annotations( + self, + **kwargs + ): + """Annotate COVID symptoms in a clinical note # noqa: E501 + + Return the COVID symptom annotations found in a clinical note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_text_covid_symptom_annotations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + text_covid_symptom_annotation_request (TextCovidSymptomAnnotationRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TextCovidSymptomAnnotationResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_text_covid_symptom_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_date_annotation_api.py b/nlpsandbox/api/text_date_annotation_api.py index 601ebf99..f7f41a08 100644 --- a/nlpsandbox/api/text_date_annotation_api.py +++ b/nlpsandbox/api/text_date_annotation_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,70 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_text_date_annotations( - self, - **kwargs - ): - """Annotate dates in a clinical note # noqa: E501 - - Return the date annotations found in a clinical note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_text_date_annotations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - text_date_annotation_request (TextDateAnnotationRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TextDateAnnotationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_text_date_annotations = _Endpoint( + self.create_text_date_annotations_endpoint = _Endpoint( settings={ 'response_type': (TextDateAnnotationResponse,), 'auth': [], @@ -147,6 +84,68 @@ def __create_text_date_annotations( 'application/json' ] }, - api_client=api_client, - callable=__create_text_date_annotations + api_client=api_client + ) + + def create_text_date_annotations( + self, + **kwargs + ): + """Annotate dates in a clinical note # noqa: E501 + + Return the date annotations found in a clinical note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_text_date_annotations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + text_date_annotation_request (TextDateAnnotationRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TextDateAnnotationResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_text_date_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_id_annotation_api.py b/nlpsandbox/api/text_id_annotation_api.py index 8d2934be..313ec002 100644 --- a/nlpsandbox/api/text_id_annotation_api.py +++ b/nlpsandbox/api/text_id_annotation_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,70 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_text_id_annotations( - self, - **kwargs - ): - """Annotate IDs in a clinical note # noqa: E501 - - Return the ID annotations found in a clinical note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_text_id_annotations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - text_id_annotation_request (TextIdAnnotationRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TextIdAnnotationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_text_id_annotations = _Endpoint( + self.create_text_id_annotations_endpoint = _Endpoint( settings={ 'response_type': (TextIdAnnotationResponse,), 'auth': [], @@ -147,6 +84,68 @@ def __create_text_id_annotations( 'application/json' ] }, - api_client=api_client, - callable=__create_text_id_annotations + api_client=api_client + ) + + def create_text_id_annotations( + self, + **kwargs + ): + """Annotate IDs in a clinical note # noqa: E501 + + Return the ID annotations found in a clinical note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_text_id_annotations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + text_id_annotation_request (TextIdAnnotationRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TextIdAnnotationResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_text_id_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_location_annotation_api.py b/nlpsandbox/api/text_location_annotation_api.py new file mode 100644 index 00000000..af502355 --- /dev/null +++ b/nlpsandbox/api/text_location_annotation_api.py @@ -0,0 +1,151 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from nlpsandbox.api_client import ApiClient, Endpoint as _Endpoint +from nlpsandbox.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from nlpsandbox.model.error import Error +from nlpsandbox.model.text_location_annotation_request import TextLocationAnnotationRequest +from nlpsandbox.model.text_location_annotation_response import TextLocationAnnotationResponse + + +class TextLocationAnnotationApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.create_text_location_annotations_endpoint = _Endpoint( + settings={ + 'response_type': (TextLocationAnnotationResponse,), + 'auth': [], + 'endpoint_path': '/textLocationAnnotations', + 'operation_id': 'create_text_location_annotations', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'text_location_annotation_request', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'text_location_annotation_request': + (TextLocationAnnotationRequest,), + }, + 'attribute_map': { + }, + 'location_map': { + 'text_location_annotation_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] + }, + api_client=api_client + ) + + def create_text_location_annotations( + self, + **kwargs + ): + """Annotate locations in a clinical note # noqa: E501 + + Return the location annotations found in a clinical note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_text_location_annotations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + text_location_annotation_request (TextLocationAnnotationRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TextLocationAnnotationResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_text_location_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_person_name_annotation_api.py b/nlpsandbox/api/text_person_name_annotation_api.py index ec3f241b..3aaee09c 100644 --- a/nlpsandbox/api/text_person_name_annotation_api.py +++ b/nlpsandbox/api/text_person_name_annotation_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,70 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __create_text_person_name_annotations( - self, - **kwargs - ): - """Annotate person names in a clinical note # noqa: E501 - - Return the person name annotations found in a clinical note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_text_person_name_annotations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - text_person_name_annotation_request (TextPersonNameAnnotationRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TextPersonNameAnnotationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_text_person_name_annotations = _Endpoint( + self.create_text_person_name_annotations_endpoint = _Endpoint( settings={ 'response_type': (TextPersonNameAnnotationResponse,), 'auth': [], @@ -147,6 +84,68 @@ def __create_text_person_name_annotations( 'application/json' ] }, - api_client=api_client, - callable=__create_text_person_name_annotations + api_client=api_client + ) + + def create_text_person_name_annotations( + self, + **kwargs + ): + """Annotate person names in a clinical note # noqa: E501 + + Return the person name annotations found in a clinical note # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_text_person_name_annotations(async_req=True) + >>> result = thread.get() + + + Keyword Args: + text_person_name_annotation_request (TextPersonNameAnnotationRequest): [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + TextPersonNameAnnotationResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.create_text_person_name_annotations_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api/text_physical_address_annotation_api.py b/nlpsandbox/api/text_physical_address_annotation_api.py deleted file mode 100644 index 41ca4d7a..00000000 --- a/nlpsandbox/api/text_physical_address_annotation_api.py +++ /dev/null @@ -1,152 +0,0 @@ -""" - NLP Sandbox API - - NLP Sandbox REST API # noqa: E501 - - The version of the OpenAPI document: 1.1.2 - Contact: team@nlpsandbox.io - Generated by: https://openapi-generator.tech -""" - - -import re # noqa: F401 -import sys # noqa: F401 - -from nlpsandbox.api_client import ApiClient, Endpoint as _Endpoint -from nlpsandbox.model_utils import ( # noqa: F401 - check_allowed_values, - check_validations, - date, - datetime, - file_type, - none_type, - validate_and_convert_types -) -from nlpsandbox.model.error import Error -from nlpsandbox.model.text_physical_address_annotation_request import TextPhysicalAddressAnnotationRequest -from nlpsandbox.model.text_physical_address_annotation_response import TextPhysicalAddressAnnotationResponse - - -class TextPhysicalAddressAnnotationApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def __create_text_physical_address_annotations( - self, - **kwargs - ): - """Annotate physical addresses in a clinical note # noqa: E501 - - Return the physical addresse annotations found in a clinical note # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_text_physical_address_annotations(async_req=True) - >>> result = thread.get() - - - Keyword Args: - text_physical_address_annotation_request (TextPhysicalAddressAnnotationRequest): [optional] - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - TextPhysicalAddressAnnotationResponse - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.create_text_physical_address_annotations = _Endpoint( - settings={ - 'response_type': (TextPhysicalAddressAnnotationResponse,), - 'auth': [], - 'endpoint_path': '/textPhysicalAddressAnnotations', - 'operation_id': 'create_text_physical_address_annotations', - 'http_method': 'POST', - 'servers': None, - }, - params_map={ - 'all': [ - 'text_physical_address_annotation_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, - root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'text_physical_address_annotation_request': - (TextPhysicalAddressAnnotationRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'text_physical_address_annotation_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] - }, - api_client=api_client, - callable=__create_text_physical_address_annotations - ) diff --git a/nlpsandbox/api/tool_api.py b/nlpsandbox/api/tool_api.py index c41f3a75..f44671ad 100644 --- a/nlpsandbox/api/tool_api.py +++ b/nlpsandbox/api/tool_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -38,69 +38,7 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client - - def __get_tool( - self, - **kwargs - ): - """Get tool information # noqa: E501 - - Get information about the tool # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_tool(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - Tool - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.get_tool = _Endpoint( + self.get_tool_endpoint = _Endpoint( settings={ 'response_type': (Tool,), 'auth': [], @@ -140,72 +78,9 @@ def __get_tool( ], 'content_type': [], }, - api_client=api_client, - callable=__get_tool + api_client=api_client ) - - def __get_tool_dependencies( - self, - **kwargs - ): - """Get tool dependencies # noqa: E501 - - Get the dependencies of this tool # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_tool_dependencies(async_req=True) - >>> result = thread.get() - - - Keyword Args: - _return_http_data_only (bool): response data without head status - code and headers. Default is True. - _preload_content (bool): if False, the urllib3.HTTPResponse object - will be returned without reading/decoding response data. - Default is True. - _request_timeout (float/tuple): timeout setting for this request. If one - number provided, it will be total request timeout. It can also - be a pair (tuple) of (connection, read) timeouts. - Default is None. - _check_input_type (bool): specifies if type checking - should be done one the data sent to the server. - Default is True. - _check_return_type (bool): specifies if type checking - should be done one the data received from the server. - Default is True. - _host_index (int/None): specifies the index of the server - that we want to use. - Default is read from the configuration. - async_req (bool): execute request asynchronously - - Returns: - ToolDependencies - If the method is called asynchronously, returns the request - thread. - """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - return self.call_with_http_info(**kwargs) - - self.get_tool_dependencies = _Endpoint( + self.get_tool_dependencies_endpoint = _Endpoint( settings={ 'response_type': (ToolDependencies,), 'auth': [], @@ -245,6 +120,128 @@ def __get_tool_dependencies( ], 'content_type': [], }, - api_client=api_client, - callable=__get_tool_dependencies + api_client=api_client + ) + + def get_tool( + self, + **kwargs + ): + """Get tool information # noqa: E501 + + Get information about the tool # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_tool(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Tool + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_tool_endpoint.call_with_http_info(**kwargs) + + def get_tool_dependencies( + self, + **kwargs + ): + """Get tool dependencies # noqa: E501 + + Get the dependencies of this tool # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_tool_dependencies(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + ToolDependencies + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_host_index'] = kwargs.get('_host_index') + return self.get_tool_dependencies_endpoint.call_with_http_info(**kwargs) + diff --git a/nlpsandbox/api_client.py b/nlpsandbox/api_client.py index f80fad75..fc9e8cdd 100644 --- a/nlpsandbox/api_client.py +++ b/nlpsandbox/api_client.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -130,7 +130,7 @@ def __call_api( _return_http_data_only: typing.Optional[bool] = None, collection_formats: typing.Optional[typing.Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None ): @@ -348,7 +348,7 @@ def call_api( _return_http_data_only: typing.Optional[bool] = None, collection_formats: typing.Optional[typing.Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None ): @@ -589,12 +589,12 @@ def select_header_content_type(self, content_types): else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings, + def update_params_for_auth(self, headers, queries, auth_settings, resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. + :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. :param resource_path: A string representation of the HTTP request resource path. :param method: A string representation of the HTTP request method. @@ -613,7 +613,7 @@ def update_params_for_auth(self, headers, querys, auth_settings, if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) + queries.append((auth_setting['key'], auth_setting['value'])) else: raise ApiValueError( 'Authentication token must be in `query` or `header`' @@ -675,7 +675,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, 'async_req': (bool,), '_host_index': (none_type, int), '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), + '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), '_check_return_type': (bool,) @@ -827,9 +827,10 @@ def call_with_http_info(self, **kwargs): content_type_headers_list = self.headers_map['content_type'] if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/nlpsandbox/apis/__init__.py b/nlpsandbox/apis/__init__.py index 0a1d0630..b908ae7a 100644 --- a/nlpsandbox/apis/__init__.py +++ b/nlpsandbox/apis/__init__.py @@ -26,6 +26,6 @@ from nlpsandbox.api.text_covid_symptom_annotation_api import TextCovidSymptomAnnotationApi from nlpsandbox.api.text_date_annotation_api import TextDateAnnotationApi from nlpsandbox.api.text_id_annotation_api import TextIdAnnotationApi +from nlpsandbox.api.text_location_annotation_api import TextLocationAnnotationApi from nlpsandbox.api.text_person_name_annotation_api import TextPersonNameAnnotationApi -from nlpsandbox.api.text_physical_address_annotation_api import TextPhysicalAddressAnnotationApi from nlpsandbox.api.tool_api import ToolApi diff --git a/nlpsandbox/configuration.py b/nlpsandbox/configuration.py index d91cd8d0..42376c81 100644 --- a/nlpsandbox/configuration.py +++ b/nlpsandbox/configuration.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -74,9 +74,29 @@ class Configuration(object): :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. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = nlpsandbox.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 """ _default = None @@ -367,6 +387,15 @@ def auth_settings(self): :return: The Auth Settings information dict. """ auth = {} + if 'ApiKeyAuth' in self.api_key: + auth['ApiKeyAuth'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-API-Key', + 'value': self.get_api_key_with_prefix( + 'ApiKeyAuth', + ), + } return auth def to_debug_report(self): @@ -377,7 +406,7 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 1.1.2\n"\ + "Version of the API: 1.2.0\n"\ "SDK Package Version: 1.0.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/nlpsandbox/exceptions.py b/nlpsandbox/exceptions.py index 12385a98..cb08ae27 100644 --- a/nlpsandbox/exceptions.py +++ b/nlpsandbox/exceptions.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/nlpsandbox/model/annotation.py b/nlpsandbox/model/annotation.py index 2d4e30fe..328fff59 100644 --- a/nlpsandbox/model/annotation.py +++ b/nlpsandbox/model/annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_name import AnnotationName @@ -34,16 +37,16 @@ def lazy_import(): from nlpsandbox.model.text_covid_symptom_annotation import TextCovidSymptomAnnotation from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.text_id_annotation import TextIdAnnotation + from nlpsandbox.model.text_location_annotation import TextLocationAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation - from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation globals()['AnnotationName'] = AnnotationName globals()['AnnotationSource'] = AnnotationSource globals()['TextContactAnnotation'] = TextContactAnnotation globals()['TextCovidSymptomAnnotation'] = TextCovidSymptomAnnotation globals()['TextDateAnnotation'] = TextDateAnnotation globals()['TextIdAnnotation'] = TextIdAnnotation + globals()['TextLocationAnnotation'] = TextLocationAnnotation globals()['TextPersonNameAnnotation'] = TextPersonNameAnnotation - globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation class Annotation(ModelNormal): @@ -76,7 +79,14 @@ class Annotation(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,7 +106,7 @@ def openapi_types(): 'annotation_source': (AnnotationSource,), # noqa: E501 'text_date_annotations': ([TextDateAnnotation],), # noqa: E501 'text_person_name_annotations': ([TextPersonNameAnnotation],), # noqa: E501 - 'text_physical_address_annotations': ([TextPhysicalAddressAnnotation],), # noqa: E501 + 'text_location_annotations': ([TextLocationAnnotation],), # noqa: E501 'text_id_annotations': ([TextIdAnnotation],), # noqa: E501 'text_contact_annotations': ([TextContactAnnotation],), # noqa: E501 'text_covid_symptom_annotations': ([TextCovidSymptomAnnotation],), # noqa: E501 @@ -112,14 +122,102 @@ def discriminator(): 'annotation_source': 'annotationSource', # noqa: E501 'text_date_annotations': 'textDateAnnotations', # noqa: E501 'text_person_name_annotations': 'textPersonNameAnnotations', # noqa: E501 - 'text_physical_address_annotations': 'textPhysicalAddressAnnotations', # noqa: E501 + 'text_location_annotations': 'textLocationAnnotations', # noqa: E501 'text_id_annotations': 'textIdAnnotations', # noqa: E501 'text_contact_annotations': 'textContactAnnotations', # noqa: E501 'text_covid_symptom_annotations': 'textCovidSymptomAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, annotation_source, *args, **kwargs): # noqa: E501 + """Annotation - a model defined in OpenAPI + + Args: + name (AnnotationName): + annotation_source (AnnotationSource): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + text_date_annotations ([TextDateAnnotation]): Date annotations in a text. [optional] # noqa: E501 + text_person_name_annotations ([TextPersonNameAnnotation]): Person name annotations in a text. [optional] # noqa: E501 + text_location_annotations ([TextLocationAnnotation]): Location annotations in a text. [optional] # noqa: E501 + text_id_annotations ([TextIdAnnotation]): ID annotations in a text. [optional] # noqa: E501 + text_contact_annotations ([TextContactAnnotation]): Contact annotations in a text. [optional] # noqa: E501 + text_covid_symptom_annotations ([TextCovidSymptomAnnotation]): COVID symptom annotations in a text. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.annotation_source = annotation_source + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,7 +268,7 @@ def __init__(self, name, annotation_source, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) text_date_annotations ([TextDateAnnotation]): Date annotations in a text. [optional] # noqa: E501 text_person_name_annotations ([TextPersonNameAnnotation]): Person name annotations in a text. [optional] # noqa: E501 - text_physical_address_annotations ([TextPhysicalAddressAnnotation]): Physical address annotations in a text. [optional] # noqa: E501 + text_location_annotations ([TextLocationAnnotation]): Location annotations in a text. [optional] # noqa: E501 text_id_annotations ([TextIdAnnotation]): ID annotations in a text. [optional] # noqa: E501 text_contact_annotations ([TextContactAnnotation]): Contact annotations in a text. [optional] # noqa: E501 text_covid_symptom_annotations ([TextCovidSymptomAnnotation]): COVID symptom annotations in a text. [optional] # noqa: E501 @@ -209,3 +307,6 @@ def __init__(self, name, annotation_source, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_create_request.py b/nlpsandbox/model/annotation_create_request.py index db3e564c..353534d4 100644 --- a/nlpsandbox/model/annotation_create_request.py +++ b/nlpsandbox/model/annotation_create_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_source import AnnotationSource @@ -33,15 +36,15 @@ def lazy_import(): from nlpsandbox.model.text_covid_symptom_annotation import TextCovidSymptomAnnotation from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.text_id_annotation import TextIdAnnotation + from nlpsandbox.model.text_location_annotation import TextLocationAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation - from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation globals()['AnnotationSource'] = AnnotationSource globals()['TextContactAnnotation'] = TextContactAnnotation globals()['TextCovidSymptomAnnotation'] = TextCovidSymptomAnnotation globals()['TextDateAnnotation'] = TextDateAnnotation globals()['TextIdAnnotation'] = TextIdAnnotation + globals()['TextLocationAnnotation'] = TextLocationAnnotation globals()['TextPersonNameAnnotation'] = TextPersonNameAnnotation - globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation class AnnotationCreateRequest(ModelNormal): @@ -74,7 +77,14 @@ class AnnotationCreateRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -93,7 +103,7 @@ def openapi_types(): 'annotation_source': (AnnotationSource,), # noqa: E501 'text_date_annotations': ([TextDateAnnotation],), # noqa: E501 'text_person_name_annotations': ([TextPersonNameAnnotation],), # noqa: E501 - 'text_physical_address_annotations': ([TextPhysicalAddressAnnotation],), # noqa: E501 + 'text_location_annotations': ([TextLocationAnnotation],), # noqa: E501 'text_id_annotations': ([TextIdAnnotation],), # noqa: E501 'text_contact_annotations': ([TextContactAnnotation],), # noqa: E501 'text_covid_symptom_annotations': ([TextCovidSymptomAnnotation],), # noqa: E501 @@ -108,14 +118,100 @@ def discriminator(): 'annotation_source': 'annotationSource', # noqa: E501 'text_date_annotations': 'textDateAnnotations', # noqa: E501 'text_person_name_annotations': 'textPersonNameAnnotations', # noqa: E501 - 'text_physical_address_annotations': 'textPhysicalAddressAnnotations', # noqa: E501 + 'text_location_annotations': 'textLocationAnnotations', # noqa: E501 'text_id_annotations': 'textIdAnnotations', # noqa: E501 'text_contact_annotations': 'textContactAnnotations', # noqa: E501 'text_covid_symptom_annotations': 'textCovidSymptomAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, annotation_source, *args, **kwargs): # noqa: E501 + """AnnotationCreateRequest - a model defined in OpenAPI + + Args: + annotation_source (AnnotationSource): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + text_date_annotations ([TextDateAnnotation]): Date annotations in a text. [optional] # noqa: E501 + text_person_name_annotations ([TextPersonNameAnnotation]): Person name annotations in a text. [optional] # noqa: E501 + text_location_annotations ([TextLocationAnnotation]): Location annotations in a text. [optional] # noqa: E501 + text_id_annotations ([TextIdAnnotation]): ID annotations in a text. [optional] # noqa: E501 + text_contact_annotations ([TextContactAnnotation]): Contact annotations in a text. [optional] # noqa: E501 + text_covid_symptom_annotations ([TextCovidSymptomAnnotation]): COVID symptom annotations in a text. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.annotation_source = annotation_source + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -165,7 +261,7 @@ def __init__(self, annotation_source, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) text_date_annotations ([TextDateAnnotation]): Date annotations in a text. [optional] # noqa: E501 text_person_name_annotations ([TextPersonNameAnnotation]): Person name annotations in a text. [optional] # noqa: E501 - text_physical_address_annotations ([TextPhysicalAddressAnnotation]): Physical address annotations in a text. [optional] # noqa: E501 + text_location_annotations ([TextLocationAnnotation]): Location annotations in a text. [optional] # noqa: E501 text_id_annotations ([TextIdAnnotation]): ID annotations in a text. [optional] # noqa: E501 text_contact_annotations ([TextContactAnnotation]): Contact annotations in a text. [optional] # noqa: E501 text_covid_symptom_annotations ([TextCovidSymptomAnnotation]): COVID symptom annotations in a text. [optional] # noqa: E501 @@ -203,3 +299,6 @@ def __init__(self, annotation_source, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_create_response.py b/nlpsandbox/model/annotation_create_response.py index 00587b2d..848991a1 100644 --- a/nlpsandbox/model/annotation_create_response.py +++ b/nlpsandbox/model/annotation_create_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_name import AnnotationName @@ -62,7 +65,14 @@ class AnnotationCreateResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """AnnotationCreateResponse - a model defined in OpenAPI + + Args: + name (AnnotationName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_id.py b/nlpsandbox/model/annotation_id.py index 3c1203c4..0282b3df 100644 --- a/nlpsandbox/model/annotation_id.py +++ b/nlpsandbox/model/annotation_id.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class AnnotationId(ModelSimple): @@ -86,6 +89,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -185,3 +190,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AnnotationId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The ID of the annotation. # noqa: E501 + + Keyword Args: + value (str): The ID of the annotation. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/annotation_name.py b/nlpsandbox/model/annotation_name.py index 59ec4ca9..44882c1a 100644 --- a/nlpsandbox/model/annotation_name.py +++ b/nlpsandbox/model/annotation_name.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class AnnotationName(ModelSimple): @@ -84,6 +87,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -183,3 +188,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AnnotationName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The resource name of the annotation record, of the form datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations/{annotationId}. # noqa: E501 + + Keyword Args: + value (str): The resource name of the annotation record, of the form datasets/{datasetId}/annotationStores/{annotationStoreId}/annotations/{annotationId}. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/annotation_set.py b/nlpsandbox/model/annotation_set.py index 7e86bcad..02f25a62 100644 --- a/nlpsandbox/model/annotation_set.py +++ b/nlpsandbox/model/annotation_set.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,18 +26,21 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_contact_annotation import TextContactAnnotation from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.text_id_annotation import TextIdAnnotation + from nlpsandbox.model.text_location_annotation import TextLocationAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation - from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation globals()['TextContactAnnotation'] = TextContactAnnotation globals()['TextDateAnnotation'] = TextDateAnnotation globals()['TextIdAnnotation'] = TextIdAnnotation + globals()['TextLocationAnnotation'] = TextLocationAnnotation globals()['TextPersonNameAnnotation'] = TextPersonNameAnnotation - globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation class AnnotationSet(ModelNormal): @@ -70,7 +73,14 @@ class AnnotationSet(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -88,7 +98,7 @@ def openapi_types(): return { 'text_date_annotations': ([TextDateAnnotation],), # noqa: E501 'text_person_name_annotations': ([TextPersonNameAnnotation],), # noqa: E501 - 'text_physical_address_annotations': ([TextPhysicalAddressAnnotation],), # noqa: E501 + 'text_location_annotations': ([TextLocationAnnotation],), # noqa: E501 'text_id_annotations': ([TextIdAnnotation],), # noqa: E501 'text_contact_annotations': ([TextContactAnnotation],), # noqa: E501 } @@ -101,13 +111,101 @@ def discriminator(): attribute_map = { 'text_date_annotations': 'textDateAnnotations', # noqa: E501 'text_person_name_annotations': 'textPersonNameAnnotations', # noqa: E501 - 'text_physical_address_annotations': 'textPhysicalAddressAnnotations', # noqa: E501 + 'text_location_annotations': 'textLocationAnnotations', # noqa: E501 'text_id_annotations': 'textIdAnnotations', # noqa: E501 'text_contact_annotations': 'textContactAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_date_annotations, text_person_name_annotations, text_location_annotations, text_id_annotations, text_contact_annotations, *args, **kwargs): # noqa: E501 + """AnnotationSet - a model defined in OpenAPI + + Args: + text_date_annotations ([TextDateAnnotation]): Date annotations in a text + text_person_name_annotations ([TextPersonNameAnnotation]): Person name annotations in a text + text_location_annotations ([TextLocationAnnotation]): Location annotations in a text + text_id_annotations ([TextIdAnnotation]): ID annotations in a text + text_contact_annotations ([TextContactAnnotation]): Contact annotations in a text + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_date_annotations = text_date_annotations + self.text_person_name_annotations = text_person_name_annotations + self.text_location_annotations = text_location_annotations + self.text_id_annotations = text_id_annotations + self.text_contact_annotations = text_contact_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -118,13 +216,13 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, text_date_annotations, text_person_name_annotations, text_physical_address_annotations, text_id_annotations, text_contact_annotations, *args, **kwargs): # noqa: E501 + def __init__(self, text_date_annotations, text_person_name_annotations, text_location_annotations, text_id_annotations, text_contact_annotations, *args, **kwargs): # noqa: E501 """AnnotationSet - a model defined in OpenAPI Args: text_date_annotations ([TextDateAnnotation]): Date annotations in a text text_person_name_annotations ([TextPersonNameAnnotation]): Person name annotations in a text - text_physical_address_annotations ([TextPhysicalAddressAnnotation]): Physical address annotations in a text + text_location_annotations ([TextLocationAnnotation]): Location annotations in a text text_id_annotations ([TextIdAnnotation]): ID annotations in a text text_contact_annotations ([TextContactAnnotation]): Contact annotations in a text @@ -186,7 +284,7 @@ def __init__(self, text_date_annotations, text_person_name_annotations, text_phy self.text_date_annotations = text_date_annotations self.text_person_name_annotations = text_person_name_annotations - self.text_physical_address_annotations = text_physical_address_annotations + self.text_location_annotations = text_location_annotations self.text_id_annotations = text_id_annotations self.text_contact_annotations = text_contact_annotations for var_name, var_value in kwargs.items(): @@ -197,3 +295,6 @@ def __init__(self, text_date_annotations, text_person_name_annotations, text_phy # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_source.py b/nlpsandbox/model/annotation_source.py index 587cb933..0ae683d3 100644 --- a/nlpsandbox/model/annotation_source.py +++ b/nlpsandbox/model/annotation_source.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.resource_source import ResourceSource @@ -65,7 +68,14 @@ class AnnotationSource(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -93,8 +103,88 @@ def discriminator(): 'resource_source': 'resourceSource', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, resource_source, *args, **kwargs): # noqa: E501 + """AnnotationSource - a model defined in OpenAPI + + Args: + resource_source (ResourceSource): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.resource_source = resource_source + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -176,3 +266,6 @@ def __init__(self, resource_source, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_store.py b/nlpsandbox/model/annotation_store.py index 901d28d8..1141b356 100644 --- a/nlpsandbox/model/annotation_store.py +++ b/nlpsandbox/model/annotation_store.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_store_name import AnnotationStoreName @@ -62,7 +65,14 @@ class AnnotationStore(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """AnnotationStore - a model defined in OpenAPI + + Args: + name (AnnotationStoreName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_store_create_response.py b/nlpsandbox/model/annotation_store_create_response.py index 0b15399b..e5d0c3e7 100644 --- a/nlpsandbox/model/annotation_store_create_response.py +++ b/nlpsandbox/model/annotation_store_create_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_store_name import AnnotationStoreName @@ -62,7 +65,14 @@ class AnnotationStoreCreateResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """AnnotationStoreCreateResponse - a model defined in OpenAPI + + Args: + name (AnnotationStoreName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/annotation_store_id.py b/nlpsandbox/model/annotation_store_id.py index 2d20e9e0..534e9805 100644 --- a/nlpsandbox/model/annotation_store_id.py +++ b/nlpsandbox/model/annotation_store_id.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class AnnotationStoreId(ModelSimple): @@ -86,6 +89,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -185,3 +190,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AnnotationStoreId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The ID of the annotation store. # noqa: E501 + + Keyword Args: + value (str): The ID of the annotation store. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/annotation_store_name.py b/nlpsandbox/model/annotation_store_name.py index e086c780..6510254a 100644 --- a/nlpsandbox/model/annotation_store_name.py +++ b/nlpsandbox/model/annotation_store_name.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class AnnotationStoreName(ModelSimple): @@ -84,6 +87,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -183,3 +188,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AnnotationStoreName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The resource name of the annotation store, of the form datasets/{datasetId}/annotationStores/{annotationStoreId}. # noqa: E501 + + Keyword Args: + value (str): The resource name of the annotation store, of the form datasets/{datasetId}/annotationStores/{annotationStoreId}. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/dataset.py b/nlpsandbox/model/dataset.py index f3547260..7b6a7427 100644 --- a/nlpsandbox/model/dataset.py +++ b/nlpsandbox/model/dataset.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.dataset_name import DatasetName @@ -62,7 +65,14 @@ class Dataset(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """Dataset - a model defined in OpenAPI + + Args: + name (DatasetName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/dataset_create_response.py b/nlpsandbox/model/dataset_create_response.py index c1784278..f70540ac 100644 --- a/nlpsandbox/model/dataset_create_response.py +++ b/nlpsandbox/model/dataset_create_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.dataset_name import DatasetName @@ -62,7 +65,14 @@ class DatasetCreateResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """DatasetCreateResponse - a model defined in OpenAPI + + Args: + name (DatasetName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/dataset_id.py b/nlpsandbox/model/dataset_id.py index d6ca854c..e5d6dac5 100644 --- a/nlpsandbox/model/dataset_id.py +++ b/nlpsandbox/model/dataset_id.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class DatasetId(ModelSimple): @@ -86,6 +89,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -185,3 +190,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DatasetId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The ID of the dataset. # noqa: E501 + + Keyword Args: + value (str): The ID of the dataset. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/dataset_name.py b/nlpsandbox/model/dataset_name.py index 43621153..8519e71e 100644 --- a/nlpsandbox/model/dataset_name.py +++ b/nlpsandbox/model/dataset_name.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class DatasetName(ModelSimple): @@ -84,6 +87,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -183,3 +188,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DatasetName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The name of the dataset. # noqa: E501 + + Keyword Args: + value (str): The name of the dataset. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/date_offset_config.py b/nlpsandbox/model/date_offset_config.py index 58a35420..347f203d 100644 --- a/nlpsandbox/model/date_offset_config.py +++ b/nlpsandbox/model/date_offset_config.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class DateOffsetConfig(ModelNormal): @@ -58,7 +61,13 @@ class DateOffsetConfig(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -85,8 +94,88 @@ def discriminator(): 'offset_days': 'offsetDays', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, offset_days, *args, **kwargs): # noqa: E501 + """DateOffsetConfig - a model defined in OpenAPI + + Args: + offset_days (int): Number of days by which to offset annotated dates. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.offset_days = offset_days + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -168,3 +257,6 @@ def __init__(self, offset_days, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/deidentification_step.py b/nlpsandbox/model/deidentification_step.py index 480ee8e8..27832ae9 100644 --- a/nlpsandbox/model/deidentification_step.py +++ b/nlpsandbox/model/deidentification_step.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.date_offset_config import DateOffsetConfig @@ -62,7 +65,7 @@ class DeidentificationStep(ModelNormal): ('annotation_types',): { 'DATE': "text_date", 'PERSON_NAME': "text_person_name", - 'PHYSICAL_ADDRESS': "text_physical_address", + 'LOCATION': "text_location", 'ID': "text_id", 'CONTACT': "text_contact", }, @@ -75,7 +78,14 @@ class DeidentificationStep(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -113,8 +123,93 @@ def discriminator(): 'date_offset_config': 'dateOffsetConfig', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, annotation_types, *args, **kwargs): # noqa: E501 + """DeidentificationStep - a model defined in OpenAPI + + Args: + annotation_types ([str]): The types of annotations to which the de-identifer should apply the selected strategy + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + confidence_threshold (float): The minimum confidence level for a given annotation to be de-identified. [optional] if omitted the server will use the default value of 0 # noqa: E501 + masking_char_config (MaskingCharConfig): [optional] # noqa: E501 + annotation_type_mask_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Configuration for the \"annotation type\" strategy. E.g. \"John Smith lives at 123 Main St\" -> \"[PERSON_NAME] lives at [LOCATION]\".. [optional] # noqa: E501 + redact_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Configuration for the redaction strategy. E.g. \"John Smith lives at 123 Main St\" -> \"lives at\".. [optional] # noqa: E501 + date_offset_config (DateOffsetConfig): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.annotation_types = annotation_types + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -164,7 +259,7 @@ def __init__(self, annotation_types, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) confidence_threshold (float): The minimum confidence level for a given annotation to be de-identified. [optional] if omitted the server will use the default value of 0 # noqa: E501 masking_char_config (MaskingCharConfig): [optional] # noqa: E501 - annotation_type_mask_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Configuration for the \"annotation type\" strategy. E.g. \"John Smith lives at 123 Main St\" -> \"[PERSON_NAME] lives at [PHYSICAL_ADDRESS]\".. [optional] # noqa: E501 + annotation_type_mask_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Configuration for the \"annotation type\" strategy. E.g. \"John Smith lives at 123 Main St\" -> \"[PERSON_NAME] lives at [LOCATION]\".. [optional] # noqa: E501 redact_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Configuration for the redaction strategy. E.g. \"John Smith lives at 123 Main St\" -> \"lives at\".. [optional] # noqa: E501 date_offset_config (DateOffsetConfig): [optional] # noqa: E501 """ @@ -201,3 +296,6 @@ def __init__(self, annotation_types, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/deidentify_request.py b/nlpsandbox/model/deidentify_request.py index 6a202792..53634832 100644 --- a/nlpsandbox/model/deidentify_request.py +++ b/nlpsandbox/model/deidentify_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.deidentification_step import DeidentificationStep @@ -64,7 +67,14 @@ class DeidentifyRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,8 +104,90 @@ def discriminator(): 'deidentification_steps': 'deidentificationSteps', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, deidentification_steps, *args, **kwargs): # noqa: E501 + """DeidentifyRequest - a model defined in OpenAPI + + Args: + note (Note): + deidentification_steps ([DeidentificationStep]): A list of deidentification steps + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + self.deidentification_steps = deidentification_steps + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -179,3 +271,6 @@ def __init__(self, note, deidentification_steps, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/deidentify_response.py b/nlpsandbox/model/deidentify_response.py index 9f77c975..4ee81d1c 100644 --- a/nlpsandbox/model/deidentify_response.py +++ b/nlpsandbox/model/deidentify_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_set import AnnotationSet @@ -64,7 +67,14 @@ class DeidentifyResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,8 +106,87 @@ def discriminator(): 'deidentified_note': 'deidentifiedNote', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DeidentifyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + original_annotations (AnnotationSet): [optional] # noqa: E501 + deidentified_annotations (AnnotationSet): [optional] # noqa: E501 + deidentified_note (Note): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -178,3 +267,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/error.py b/nlpsandbox/model/error.py index cb15a437..984f5b26 100644 --- a/nlpsandbox/model/error.py +++ b/nlpsandbox/model/error.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class Error(ModelNormal): @@ -58,7 +61,13 @@ class Error(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -91,8 +100,92 @@ def discriminator(): 'type': 'type', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, title, status, *args, **kwargs): # noqa: E501 + """Error - a model defined in OpenAPI + + Args: + title (str): A human readable documentation for the problem type + status (int): The HTTP status code + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + detail (str): A human readable explanation specific to this occurrence of the problem. [optional] # noqa: E501 + type (str): An absolute URI that identifies the problem type. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.title = title + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -178,3 +271,6 @@ def __init__(self, title, status, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/fhir_store.py b/nlpsandbox/model/fhir_store.py index 116f1534..9e45c501 100644 --- a/nlpsandbox/model/fhir_store.py +++ b/nlpsandbox/model/fhir_store.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.fhir_store_name import FhirStoreName @@ -62,7 +65,14 @@ class FhirStore(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """FhirStore - a model defined in OpenAPI + + Args: + name (FhirStoreName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/fhir_store_create_response.py b/nlpsandbox/model/fhir_store_create_response.py index 5dffa419..39d67735 100644 --- a/nlpsandbox/model/fhir_store_create_response.py +++ b/nlpsandbox/model/fhir_store_create_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.fhir_store_name import FhirStoreName @@ -62,7 +65,14 @@ class FhirStoreCreateResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """FhirStoreCreateResponse - a model defined in OpenAPI + + Args: + name (FhirStoreName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/fhir_store_id.py b/nlpsandbox/model/fhir_store_id.py index da25edfd..07fe2f14 100644 --- a/nlpsandbox/model/fhir_store_id.py +++ b/nlpsandbox/model/fhir_store_id.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class FhirStoreId(ModelSimple): @@ -86,6 +89,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -185,3 +190,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FhirStoreId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The ID of the FHIR store. # noqa: E501 + + Keyword Args: + value (str): The ID of the FHIR store. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/fhir_store_name.py b/nlpsandbox/model/fhir_store_name.py index 751387c8..a6ecdbfe 100644 --- a/nlpsandbox/model/fhir_store_name.py +++ b/nlpsandbox/model/fhir_store_name.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class FhirStoreName(ModelSimple): @@ -84,6 +87,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -183,3 +188,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FhirStoreName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The resource name of the FHIR store, of the form datasets/{datasetId}/fhirStores/{fhirStoreId}. # noqa: E501 + + Keyword Args: + value (str): The resource name of the FHIR store, of the form datasets/{datasetId}/fhirStores/{fhirStoreId}. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/health_check.py b/nlpsandbox/model/health_check.py index f729d410..6fb0e4c7 100644 --- a/nlpsandbox/model/health_check.py +++ b/nlpsandbox/model/health_check.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class HealthCheck(ModelNormal): @@ -63,7 +66,13 @@ class HealthCheck(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +99,88 @@ def discriminator(): 'status': 'status', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, status, *args, **kwargs): # noqa: E501 + """HealthCheck - a model defined in OpenAPI + + Args: + status (str): Indicates whether the service status is acceptable or not + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.status = status + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +262,6 @@ def __init__(self, status, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/license.py b/nlpsandbox/model/license.py index 16dd9456..fdc8456a 100644 --- a/nlpsandbox/model/license.py +++ b/nlpsandbox/model/license.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class License(ModelSimple): @@ -116,6 +119,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -215,3 +220,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """License - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The license (license keyword used by GitHub)., must be one of ["afl-3.0", "apache-2.0", "artistic-2.0", "bsl-1.0", "bsd-2-clause", "bsd-3-clause", "bsd-3-clause-clear", "cc", "cc0-1.0", "cc-by-4.0", "cc-by-sa-4.0", "wtfpl", "ecl-2.0", "epl-1.0", "epl-2.0", "eupl-1.1", "agpl-3.0", "gpl", "gpl-2.0", "gpl-3.0", "lgpl", "lgpl-2.1", "lgpl-3.0", "isc", "lppl-1.3c", "ms-pl", "mit", "mpl-2.0", "osl-3.0", "postgresql", "ofl-1.1", "ncsa", "unlicense", "zlib", "none", ] # noqa: E501 + + Keyword Args: + value (str): The license (license keyword used by GitHub)., must be one of ["afl-3.0", "apache-2.0", "artistic-2.0", "bsl-1.0", "bsd-2-clause", "bsd-3-clause", "bsd-3-clause-clear", "cc", "cc0-1.0", "cc-by-4.0", "cc-by-sa-4.0", "wtfpl", "ecl-2.0", "epl-1.0", "epl-2.0", "eupl-1.1", "agpl-3.0", "gpl", "gpl-2.0", "gpl-3.0", "lgpl", "lgpl-2.1", "lgpl-3.0", "isc", "lppl-1.3c", "ms-pl", "mit", "mpl-2.0", "osl-3.0", "postgresql", "ofl-1.1", "ncsa", "unlicense", "zlib", "none", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/masking_char_config.py b/nlpsandbox/model/masking_char_config.py index 19ee7211..3b84edec 100644 --- a/nlpsandbox/model/masking_char_config.py +++ b/nlpsandbox/model/masking_char_config.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class MaskingCharConfig(ModelNormal): @@ -62,7 +65,13 @@ class MaskingCharConfig(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -89,8 +98,85 @@ def discriminator(): 'masking_char': 'maskingChar', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MaskingCharConfig - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + masking_char (str): Character used to mask sensitive information. [optional] if omitted the server will use the default value of "*" # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -169,3 +255,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/note.py b/nlpsandbox/model/note.py index 06868bc3..422be585 100644 --- a/nlpsandbox/model/note.py +++ b/nlpsandbox/model/note.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note_id import NoteId @@ -64,7 +67,14 @@ class Note(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -98,8 +108,94 @@ def discriminator(): 'patient_id': 'patientId', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, identifier, text, type, patient_id, *args, **kwargs): # noqa: E501 + """Note - a model defined in OpenAPI + + Args: + identifier (NoteId): + text (str): The content of the clinical note + type (str): The note type (LOINC concept) + patient_id (PatientId): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.identifier = identifier + self.text = text + self.type = type + self.patient_id = patient_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -187,3 +283,6 @@ def __init__(self, identifier, text, type, patient_id, *args, **kwargs): # noqa # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/note_create_request.py b/nlpsandbox/model/note_create_request.py index 13d82a3e..56d15a89 100644 --- a/nlpsandbox/model/note_create_request.py +++ b/nlpsandbox/model/note_create_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.patient_id import PatientId @@ -62,7 +65,14 @@ class NoteCreateRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,8 +104,92 @@ def discriminator(): 'patient_id': 'patientId', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text, type, patient_id, *args, **kwargs): # noqa: E501 + """NoteCreateRequest - a model defined in OpenAPI + + Args: + text (str): The content of the clinical note + type (str): The note type (LOINC concept) + patient_id (PatientId): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text = text + self.type = type + self.patient_id = patient_id + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -181,3 +275,6 @@ def __init__(self, text, type, patient_id, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/note_create_response.py b/nlpsandbox/model/note_create_response.py index bb12fc47..d665cada 100644 --- a/nlpsandbox/model/note_create_response.py +++ b/nlpsandbox/model/note_create_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note_resource_name import NoteResourceName @@ -62,7 +65,14 @@ class NoteCreateResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """NoteCreateResponse - a model defined in OpenAPI + + Args: + name (NoteResourceName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/note_id.py b/nlpsandbox/model/note_id.py index e511be2e..1acc8b3d 100644 --- a/nlpsandbox/model/note_id.py +++ b/nlpsandbox/model/note_id.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class NoteId(ModelSimple): @@ -86,6 +89,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -185,3 +190,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NoteId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The ID of the clinical note. # noqa: E501 + + Keyword Args: + value (str): The ID of the clinical note. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/note_resource_name.py b/nlpsandbox/model/note_resource_name.py index 257fecf2..eb4ba9f2 100644 --- a/nlpsandbox/model/note_resource_name.py +++ b/nlpsandbox/model/note_resource_name.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class NoteResourceName(ModelSimple): @@ -84,6 +87,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -183,3 +188,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NoteResourceName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The resource name of the clinical note, of the form datasets/{datasetId}/fhirStores/{fhirStoreId}/Note/{NoteId}. # noqa: E501 + + Keyword Args: + value (str): The resource name of the clinical note, of the form datasets/{datasetId}/fhirStores/{fhirStoreId}/Note/{NoteId}. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/page_limit.py b/nlpsandbox/model/page_limit.py index dec89843..3e7685a9 100644 --- a/nlpsandbox/model/page_limit.py +++ b/nlpsandbox/model/page_limit.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class PageLimit(ModelSimple): @@ -83,6 +86,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -178,3 +183,93 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PageLimit - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): The maximum number of results returned. if omitted defaults to 10 # noqa: E501 + + Keyword Args: + value (int): The maximum number of results returned. if omitted defaults to 10 # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 10 + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/page_of_annotation_stores.py b/nlpsandbox/model/page_of_annotation_stores.py index 17744589..a2392850 100644 --- a/nlpsandbox/model/page_of_annotation_stores.py +++ b/nlpsandbox/model/page_of_annotation_stores.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_store import AnnotationStore @@ -115,6 +118,102 @@ def discriminator(): 'annotation_stores': 'annotationStores', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfAnnotationStores - a model defined in OpenAPI + + Keyword Args: + offset (PageOffset): + limit (PageLimit): + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + annotation_stores ([AnnotationStore]): An array of annotation stores + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -128,17 +227,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, offset, limit, links, total_results, annotation_stores, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """PageOfAnnotationStores - a model defined in OpenAPI - Args: + Keyword Args: offset (PageOffset): limit (PageLimit): links (ResponsePageMetadataLinks): total_results (int): The total number of results in the result set annotation_stores ([AnnotationStore]): An array of annotation stores - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -201,40 +298,31 @@ def __init__(self, offset, limit, links, total_results, annotation_stores, *args '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'offset': offset, - 'limit': limit, - 'links': links, - 'total_results': total_results, - 'annotation_stores': annotation_stores, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/page_of_annotation_stores_all_of.py b/nlpsandbox/model/page_of_annotation_stores_all_of.py index f9077073..f35dc709 100644 --- a/nlpsandbox/model/page_of_annotation_stores_all_of.py +++ b/nlpsandbox/model/page_of_annotation_stores_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation_store import AnnotationStore @@ -62,7 +65,14 @@ class PageOfAnnotationStoresAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,85 @@ def discriminator(): 'annotation_stores': 'annotationStores', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfAnnotationStoresAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + annotation_stores ([AnnotationStore]): An array of annotation stores. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/page_of_annotations.py b/nlpsandbox/model/page_of_annotations.py index 07a8760c..6bb9a066 100644 --- a/nlpsandbox/model/page_of_annotations.py +++ b/nlpsandbox/model/page_of_annotations.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation import Annotation @@ -115,6 +118,102 @@ def discriminator(): 'annotations': 'annotations', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfAnnotations - a model defined in OpenAPI + + Keyword Args: + offset (PageOffset): + limit (PageLimit): + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + annotations ([Annotation]): An array of annotations + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -128,17 +227,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, offset, limit, links, total_results, annotations, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """PageOfAnnotations - a model defined in OpenAPI - Args: + Keyword Args: offset (PageOffset): limit (PageLimit): links (ResponsePageMetadataLinks): total_results (int): The total number of results in the result set annotations ([Annotation]): An array of annotations - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -201,40 +298,31 @@ def __init__(self, offset, limit, links, total_results, annotations, *args, **kw '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'offset': offset, - 'limit': limit, - 'links': links, - 'total_results': total_results, - 'annotations': annotations, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/page_of_annotations_all_of.py b/nlpsandbox/model/page_of_annotations_all_of.py index 289fb906..79bf2abb 100644 --- a/nlpsandbox/model/page_of_annotations_all_of.py +++ b/nlpsandbox/model/page_of_annotations_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.annotation import Annotation @@ -62,7 +65,14 @@ class PageOfAnnotationsAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,85 @@ def discriminator(): 'annotations': 'annotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfAnnotationsAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + annotations ([Annotation]): An array of annotations. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/page_of_datasets.py b/nlpsandbox/model/page_of_datasets.py index ece047d8..e00b189f 100644 --- a/nlpsandbox/model/page_of_datasets.py +++ b/nlpsandbox/model/page_of_datasets.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.dataset import Dataset @@ -115,6 +118,102 @@ def discriminator(): 'datasets': 'datasets', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfDatasets - a model defined in OpenAPI + + Keyword Args: + offset (PageOffset): + limit (PageLimit): + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + datasets ([Dataset]): An array of datasets + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -128,17 +227,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, offset, limit, links, total_results, datasets, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """PageOfDatasets - a model defined in OpenAPI - Args: + Keyword Args: offset (PageOffset): limit (PageLimit): links (ResponsePageMetadataLinks): total_results (int): The total number of results in the result set datasets ([Dataset]): An array of datasets - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -201,40 +298,31 @@ def __init__(self, offset, limit, links, total_results, datasets, *args, **kwarg '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'offset': offset, - 'limit': limit, - 'links': links, - 'total_results': total_results, - 'datasets': datasets, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/page_of_datasets_all_of.py b/nlpsandbox/model/page_of_datasets_all_of.py index c89e3b30..565c0728 100644 --- a/nlpsandbox/model/page_of_datasets_all_of.py +++ b/nlpsandbox/model/page_of_datasets_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.dataset import Dataset @@ -62,7 +65,14 @@ class PageOfDatasetsAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,85 @@ def discriminator(): 'datasets': 'datasets', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfDatasetsAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + datasets ([Dataset]): An array of datasets. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/page_of_fhir_stores.py b/nlpsandbox/model/page_of_fhir_stores.py index 70253fd4..401fce24 100644 --- a/nlpsandbox/model/page_of_fhir_stores.py +++ b/nlpsandbox/model/page_of_fhir_stores.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.fhir_store import FhirStore @@ -115,6 +118,102 @@ def discriminator(): 'fhir_stores': 'fhirStores', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfFhirStores - a model defined in OpenAPI + + Keyword Args: + offset (PageOffset): + limit (PageLimit): + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + fhir_stores ([FhirStore]): An array of FHIR stores + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -128,17 +227,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, offset, limit, links, total_results, fhir_stores, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """PageOfFhirStores - a model defined in OpenAPI - Args: + Keyword Args: offset (PageOffset): limit (PageLimit): links (ResponsePageMetadataLinks): total_results (int): The total number of results in the result set fhir_stores ([FhirStore]): An array of FHIR stores - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -201,40 +298,31 @@ def __init__(self, offset, limit, links, total_results, fhir_stores, *args, **kw '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'offset': offset, - 'limit': limit, - 'links': links, - 'total_results': total_results, - 'fhir_stores': fhir_stores, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/page_of_fhir_stores_all_of.py b/nlpsandbox/model/page_of_fhir_stores_all_of.py index a813d1fb..480c2f3d 100644 --- a/nlpsandbox/model/page_of_fhir_stores_all_of.py +++ b/nlpsandbox/model/page_of_fhir_stores_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.fhir_store import FhirStore @@ -62,7 +65,14 @@ class PageOfFhirStoresAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,85 @@ def discriminator(): 'fhir_stores': 'fhirStores', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfFhirStoresAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + fhir_stores ([FhirStore]): An array of FHIR stores. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/page_of_notes.py b/nlpsandbox/model/page_of_notes.py index 21b4f60f..63467de6 100644 --- a/nlpsandbox/model/page_of_notes.py +++ b/nlpsandbox/model/page_of_notes.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -115,6 +118,102 @@ def discriminator(): 'notes': 'notes', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfNotes - a model defined in OpenAPI + + Keyword Args: + offset (PageOffset): + limit (PageLimit): + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + notes ([Note]): An array of notes + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -128,17 +227,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, offset, limit, links, total_results, notes, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """PageOfNotes - a model defined in OpenAPI - Args: + Keyword Args: offset (PageOffset): limit (PageLimit): links (ResponsePageMetadataLinks): total_results (int): The total number of results in the result set notes ([Note]): An array of notes - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -201,40 +298,31 @@ def __init__(self, offset, limit, links, total_results, notes, *args, **kwargs): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'offset': offset, - 'limit': limit, - 'links': links, - 'total_results': total_results, - 'notes': notes, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/page_of_notes_all_of.py b/nlpsandbox/model/page_of_notes_all_of.py index 0b247d6f..491c3aa1 100644 --- a/nlpsandbox/model/page_of_notes_all_of.py +++ b/nlpsandbox/model/page_of_notes_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -62,7 +65,14 @@ class PageOfNotesAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,85 @@ def discriminator(): 'notes': 'notes', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfNotesAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + notes ([Note]): An array of notes. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/page_of_patients.py b/nlpsandbox/model/page_of_patients.py index f79a6f08..a8f9295d 100644 --- a/nlpsandbox/model/page_of_patients.py +++ b/nlpsandbox/model/page_of_patients.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.page_limit import PageLimit @@ -115,6 +118,102 @@ def discriminator(): 'patients': 'patients', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfPatients - a model defined in OpenAPI + + Keyword Args: + offset (PageOffset): + limit (PageLimit): + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + patients ([Patient]): An array of FHIR patients + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -128,17 +227,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, offset, limit, links, total_results, patients, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """PageOfPatients - a model defined in OpenAPI - Args: + Keyword Args: offset (PageOffset): limit (PageLimit): links (ResponsePageMetadataLinks): total_results (int): The total number of results in the result set patients ([Patient]): An array of FHIR patients - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -201,40 +298,31 @@ def __init__(self, offset, limit, links, total_results, patients, *args, **kwarg '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'offset': offset, - 'limit': limit, - 'links': links, - 'total_results': total_results, - 'patients': patients, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/page_of_patients_all_of.py b/nlpsandbox/model/page_of_patients_all_of.py index 609e9963..7b30cfe1 100644 --- a/nlpsandbox/model/page_of_patients_all_of.py +++ b/nlpsandbox/model/page_of_patients_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.patient import Patient @@ -62,7 +65,14 @@ class PageOfPatientsAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,85 @@ def discriminator(): 'patients': 'patients', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PageOfPatientsAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + patients ([Patient]): An array of FHIR patients. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -170,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/page_offset.py b/nlpsandbox/model/page_offset.py index 14ef33f2..7c7faed3 100644 --- a/nlpsandbox/model/page_offset.py +++ b/nlpsandbox/model/page_offset.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class PageOffset(ModelSimple): @@ -82,6 +85,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -177,3 +182,93 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PageOffset - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): The index of the first result that must be returned. if omitted defaults to 0 # noqa: E501 + + Keyword Args: + value (int): The index of the first result that must be returned. if omitted defaults to 0 # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + value = 0 + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/patient.py b/nlpsandbox/model/patient.py index f19a910f..39bd1e90 100644 --- a/nlpsandbox/model/patient.py +++ b/nlpsandbox/model/patient.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.patient_id import PatientId @@ -68,7 +71,14 @@ class Patient(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -98,8 +108,89 @@ def discriminator(): 'gender': 'gender', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, identifier, *args, **kwargs): # noqa: E501 + """Patient - a model defined in OpenAPI + + Args: + identifier (PatientId): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + gender (str): Gender of the patient. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.identifier = identifier + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -182,3 +273,6 @@ def __init__(self, identifier, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/patient_create_request.py b/nlpsandbox/model/patient_create_request.py index 220e290e..f96a7cc3 100644 --- a/nlpsandbox/model/patient_create_request.py +++ b/nlpsandbox/model/patient_create_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class PatientCreateRequest(ModelNormal): @@ -64,7 +67,13 @@ class PatientCreateRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -91,8 +100,85 @@ def discriminator(): 'gender': 'gender', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PatientCreateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + gender (str): Gender of the patient. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -171,3 +257,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/patient_create_response.py b/nlpsandbox/model/patient_create_response.py index 21b8ac68..22f01df1 100644 --- a/nlpsandbox/model/patient_create_response.py +++ b/nlpsandbox/model/patient_create_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.patient_resource_name import PatientResourceName @@ -62,7 +65,14 @@ class PatientCreateResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """PatientCreateResponse - a model defined in OpenAPI + + Args: + name (PatientResourceName): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/patient_id.py b/nlpsandbox/model/patient_id.py index 5de6321b..da75839a 100644 --- a/nlpsandbox/model/patient_id.py +++ b/nlpsandbox/model/patient_id.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class PatientId(ModelSimple): @@ -86,6 +89,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -185,3 +190,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PatientId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The ID of the FHIR patient. # noqa: E501 + + Keyword Args: + value (str): The ID of the FHIR patient. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/patient_resource_name.py b/nlpsandbox/model/patient_resource_name.py index 2ea1f331..6e439122 100644 --- a/nlpsandbox/model/patient_resource_name.py +++ b/nlpsandbox/model/patient_resource_name.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class PatientResourceName(ModelSimple): @@ -84,6 +87,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -183,3 +188,97 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PatientResourceName - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The resource name of the FHIR patient, of the form datasets/{datasetId}/fhirStores/{fhirStoreId}/Patient/{PatientId}. # noqa: E501 + + Keyword Args: + value (str): The resource name of the FHIR patient, of the form datasets/{datasetId}/fhirStores/{fhirStoreId}/Patient/{PatientId}. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/programming_language.py b/nlpsandbox/model/programming_language.py new file mode 100644 index 00000000..28b14666 --- /dev/null +++ b/nlpsandbox/model/programming_language.py @@ -0,0 +1,336 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from nlpsandbox.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + + + +class ProgrammingLanguage(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('value',): { + 'APL': "APL", + 'ASP': "ASP", + 'ADA': "Ada", + 'ASSEMBLY': "Assembly", + 'AWK': "Awk", + 'BASIC': "Basic", + 'C': "C", + 'C#': "C#", + 'C++': "C++", + 'CLOJURE': "Clojure", + 'CYTHON': "Cython", + 'DART': "Dart", + 'DELPHI/KYLIX': "Delphi/Kylix", + 'EMACS-LISP': "Emacs-Lisp", + 'ERLANG': "Erlang", + 'EULER': "Euler", + 'FORTH': "Forth", + 'FORTRAN': "Fortran", + 'GO': "Go", + 'GROOVY': "Groovy", + 'HASKELL': "Haskell", + 'JAVA': "Java", + 'JAVASCRIPT': "JavaScript", + 'JULIA': "Julia", + 'KOTLIN': "Kotlin", + 'LISP': "Lisp", + 'LOGO': "Logo", + 'MATLAB': "MATLAB", + 'ML': "ML", + 'OCAML': "OCaml", + 'OBJECT_PASCAL': "Object Pascal", + 'OBJECTIVE_C': "Objective C", + 'OTHER': "Other", + 'OTHER_SCRIPTING_ENGINES': "Other Scripting Engines", + 'PHP': "PHP", + 'PL/SQL': "PL/SQL", + 'PASCAL': "Pascal", + 'PERL': "Perl", + 'PIKE': "Pike", + 'PROLOG': "Prolog", + 'PYTHON': "Python", + 'R': "R", + 'REBOL': "REBOL", + 'REXX': "Rexx", + 'RUBY': "Ruby", + 'RUST': "Rust", + 'SCALA': "Scala", + 'SCHEME': "Scheme", + 'SQL': "SQL", + 'TCL': "Tcl", + 'TYPESCRIPT': "TypeScript", + 'UNIX_SHELL': "Unix Shell", + 'VISUAL_BASIC': "Visual Basic", + 'YACC': "YACC", + 'ZOPE': "Zope", + }, + } + + validations = { + } + + additional_properties_type = None + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """ProgrammingLanguage - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): A programming language., must be one of ["APL", "ASP", "Ada", "Assembly", "Awk", "Basic", "C", "C#", "C++", "Clojure", "Cython", "Dart", "Delphi/Kylix", "Emacs-Lisp", "Erlang", "Euler", "Forth", "Fortran", "Go", "Groovy", "Haskell", "Java", "JavaScript", "Julia", "Kotlin", "Lisp", "Logo", "MATLAB", "ML", "OCaml", "Object Pascal", "Objective C", "Other", "Other Scripting Engines", "PHP", "PL/SQL", "Pascal", "Perl", "Pike", "Prolog", "Python", "R", "REBOL", "Rexx", "Ruby", "Rust", "Scala", "Scheme", "SQL", "Tcl", "TypeScript", "Unix Shell", "Visual Basic", "YACC", "Zope", ] # noqa: E501 + + Keyword Args: + value (str): A programming language., must be one of ["APL", "ASP", "Ada", "Assembly", "Awk", "Basic", "C", "C#", "C++", "Clojure", "Cython", "Dart", "Delphi/Kylix", "Emacs-Lisp", "Erlang", "Euler", "Forth", "Fortran", "Go", "Groovy", "Haskell", "Java", "JavaScript", "Julia", "Kotlin", "Lisp", "Logo", "MATLAB", "ML", "OCaml", "Object Pascal", "Objective C", "Other", "Other Scripting Engines", "PHP", "PL/SQL", "Pascal", "Perl", "Pike", "Prolog", "Python", "R", "REBOL", "Rexx", "Ruby", "Rust", "Scala", "Scheme", "SQL", "Tcl", "TypeScript", "Unix Shell", "Visual Basic", "YACC", "Zope", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ProgrammingLanguage - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): A programming language., must be one of ["APL", "ASP", "Ada", "Assembly", "Awk", "Basic", "C", "C#", "C++", "Clojure", "Cython", "Dart", "Delphi/Kylix", "Emacs-Lisp", "Erlang", "Euler", "Forth", "Fortran", "Go", "Groovy", "Haskell", "Java", "JavaScript", "Julia", "Kotlin", "Lisp", "Logo", "MATLAB", "ML", "OCaml", "Object Pascal", "Objective C", "Other", "Other Scripting Engines", "PHP", "PL/SQL", "Pascal", "Perl", "Pike", "Prolog", "Python", "R", "REBOL", "Rexx", "Ruby", "Rust", "Scala", "Scheme", "SQL", "Tcl", "TypeScript", "Unix Shell", "Visual Basic", "YACC", "Zope", ] # noqa: E501 + + Keyword Args: + value (str): A programming language., must be one of ["APL", "ASP", "Ada", "Assembly", "Awk", "Basic", "C", "C#", "C++", "Clojure", "Cython", "Dart", "Delphi/Kylix", "Emacs-Lisp", "Erlang", "Euler", "Forth", "Fortran", "Go", "Groovy", "Haskell", "Java", "JavaScript", "Julia", "Kotlin", "Lisp", "Logo", "MATLAB", "ML", "OCaml", "Object Pascal", "Objective C", "Other", "Other Scripting Engines", "PHP", "PL/SQL", "Pascal", "Perl", "Pike", "Prolog", "Python", "R", "REBOL", "Rexx", "Ruby", "Rust", "Scala", "Scheme", "SQL", "Tcl", "TypeScript", "Unix Shell", "Visual Basic", "YACC", "Zope", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/nlpsandbox/model/resource_source.py b/nlpsandbox/model/resource_source.py index d3814229..82be8c15 100644 --- a/nlpsandbox/model/resource_source.py +++ b/nlpsandbox/model/resource_source.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class ResourceSource(ModelNormal): @@ -58,7 +61,13 @@ class ResourceSource(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -85,8 +94,88 @@ def discriminator(): 'name': 'name', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """ResourceSource - a model defined in OpenAPI + + Args: + name (str): Full path of an API resource + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -168,3 +257,6 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/response_page_metadata.py b/nlpsandbox/model/response_page_metadata.py index d10dea2a..5d7e367a 100644 --- a/nlpsandbox/model/response_page_metadata.py +++ b/nlpsandbox/model/response_page_metadata.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.page_limit import PageLimit @@ -66,7 +69,14 @@ class ResponsePageMetadata(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -100,8 +110,92 @@ def discriminator(): 'limit': 'limit', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, links, total_results, *args, **kwargs): # noqa: E501 + """ResponsePageMetadata - a model defined in OpenAPI + + Args: + links (ResponsePageMetadataLinks): + total_results (int): The total number of results in the result set + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + offset (PageOffset): [optional] # noqa: E501 + limit (PageLimit): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.links = links + self.total_results = total_results + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -187,3 +281,6 @@ def __init__(self, links, total_results, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/response_page_metadata_links.py b/nlpsandbox/model/response_page_metadata_links.py index a4a0cdae..540a3323 100644 --- a/nlpsandbox/model/response_page_metadata_links.py +++ b/nlpsandbox/model/response_page_metadata_links.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class ResponsePageMetadataLinks(ModelNormal): @@ -58,7 +61,13 @@ class ResponsePageMetadataLinks(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -85,8 +94,85 @@ def discriminator(): 'next': 'next', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ResponsePageMetadataLinks - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str): Link to the next page of results. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -165,3 +251,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_annotation.py b/nlpsandbox/model/text_annotation.py index 778da876..61c6b588 100644 --- a/nlpsandbox/model/text_annotation.py +++ b/nlpsandbox/model/text_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class TextAnnotation(ModelNormal): @@ -62,7 +65,13 @@ class TextAnnotation(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -95,8 +104,94 @@ def discriminator(): 'confidence': 'confidence', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, start, length, text, confidence, *args, **kwargs): # noqa: E501 + """TextAnnotation - a model defined in OpenAPI + + Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.start = start + self.length = length + self.text = text + self.confidence = confidence + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -184,3 +279,6 @@ def __init__(self, start, length, text, confidence, *args, **kwargs): # noqa: E # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_contact_annotation.py b/nlpsandbox/model/text_contact_annotation.py index 00aeae23..c15f6853 100644 --- a/nlpsandbox/model/text_contact_annotation.py +++ b/nlpsandbox/model/text_contact_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_annotation import TextAnnotation @@ -119,6 +122,102 @@ def discriminator(): 'contact_type': 'contactType', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextContactAnnotation - a model defined in OpenAPI + + Keyword Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + contact_type (str): Type of contact information + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -132,17 +231,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, start, length, text, confidence, contact_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """TextContactAnnotation - a model defined in OpenAPI - Args: + Keyword Args: start (int): The position of the first character length (int): The length of the annotation text (str): The string annotated confidence (float): The confidence in the accuracy of the annotation contact_type (str): Type of contact information - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -205,40 +302,31 @@ def __init__(self, start, length, text, confidence, contact_type, *args, **kwarg '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'start': start, - 'length': length, - 'text': text, - 'confidence': confidence, - 'contact_type': contact_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/text_contact_annotation_all_of.py b/nlpsandbox/model/text_contact_annotation_all_of.py index ce3c3a3d..10104acd 100644 --- a/nlpsandbox/model/text_contact_annotation_all_of.py +++ b/nlpsandbox/model/text_contact_annotation_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class TextContactAnnotationAllOf(ModelNormal): @@ -66,7 +69,13 @@ class TextContactAnnotationAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -93,8 +102,88 @@ def discriminator(): 'contact_type': 'contactType', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, contact_type, *args, **kwargs): # noqa: E501 + """TextContactAnnotationAllOf - a model defined in OpenAPI + + Args: + contact_type (str): Type of contact information + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.contact_type = contact_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -176,3 +265,6 @@ def __init__(self, contact_type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_contact_annotation_request.py b/nlpsandbox/model/text_contact_annotation_request.py index 55ff8603..792cd130 100644 --- a/nlpsandbox/model/text_contact_annotation_request.py +++ b/nlpsandbox/model/text_contact_annotation_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -62,7 +65,14 @@ class TextContactAnnotationRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'note': 'note', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, *args, **kwargs): # noqa: E501 + """TextContactAnnotationRequest - a model defined in OpenAPI + + Args: + note (Note): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, note, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_contact_annotation_response.py b/nlpsandbox/model/text_contact_annotation_response.py index 093bdb16..a8c9793a 100644 --- a/nlpsandbox/model/text_contact_annotation_response.py +++ b/nlpsandbox/model/text_contact_annotation_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_contact_annotation import TextContactAnnotation @@ -62,7 +65,14 @@ class TextContactAnnotationResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'text_contact_annotations': 'textContactAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_contact_annotations, *args, **kwargs): # noqa: E501 + """TextContactAnnotationResponse - a model defined in OpenAPI + + Args: + text_contact_annotations ([TextContactAnnotation]): A list of contact annotations + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_contact_annotations = text_contact_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, text_contact_annotations, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_covid_symptom_annotation.py b/nlpsandbox/model/text_covid_symptom_annotation.py index 02f7eb50..d03e157d 100644 --- a/nlpsandbox/model/text_covid_symptom_annotation.py +++ b/nlpsandbox/model/text_covid_symptom_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_annotation import TextAnnotation @@ -140,6 +143,103 @@ def discriminator(): 'certainty': 'certainty', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextCovidSymptomAnnotation - a model defined in OpenAPI + + Keyword Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + condition (str): The sign/symptom type according to CDC definition + certainty (str): Whether the annotation is positively or negatively correlated with the presence of COVID + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -153,18 +253,16 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, start, length, text, confidence, condition, certainty, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """TextCovidSymptomAnnotation - a model defined in OpenAPI - Args: + Keyword Args: start (int): The position of the first character length (int): The length of the annotation text (str): The string annotated confidence (float): The confidence in the accuracy of the annotation condition (str): The sign/symptom type according to CDC definition certainty (str): Whether the annotation is positively or negatively correlated with the presence of COVID - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -227,41 +325,31 @@ def __init__(self, start, length, text, confidence, condition, certainty, *args, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'start': start, - 'length': length, - 'text': text, - 'confidence': confidence, - 'condition': condition, - 'certainty': certainty, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/text_covid_symptom_annotation_all_of.py b/nlpsandbox/model/text_covid_symptom_annotation_all_of.py index 67fbee3d..79f5c7d4 100644 --- a/nlpsandbox/model/text_covid_symptom_annotation_all_of.py +++ b/nlpsandbox/model/text_covid_symptom_annotation_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class TextCovidSymptomAnnotationAllOf(ModelNormal): @@ -85,7 +88,13 @@ class TextCovidSymptomAnnotationAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -114,8 +123,90 @@ def discriminator(): 'certainty': 'certainty', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, condition, certainty, *args, **kwargs): # noqa: E501 + """TextCovidSymptomAnnotationAllOf - a model defined in OpenAPI + + Args: + condition (str): The sign/symptom type according to CDC definition + certainty (str): Whether the annotation is positively or negatively correlated with the presence of COVID + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.condition = condition + self.certainty = certainty + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -199,3 +290,6 @@ def __init__(self, condition, certainty, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_covid_symptom_annotation_request.py b/nlpsandbox/model/text_covid_symptom_annotation_request.py index 4c45b1d4..d7ce3221 100644 --- a/nlpsandbox/model/text_covid_symptom_annotation_request.py +++ b/nlpsandbox/model/text_covid_symptom_annotation_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -62,7 +65,14 @@ class TextCovidSymptomAnnotationRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'note': 'note', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, *args, **kwargs): # noqa: E501 + """TextCovidSymptomAnnotationRequest - a model defined in OpenAPI + + Args: + note (Note): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, note, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_covid_symptom_annotation_response.py b/nlpsandbox/model/text_covid_symptom_annotation_response.py index e8aafdac..8568d8bb 100644 --- a/nlpsandbox/model/text_covid_symptom_annotation_response.py +++ b/nlpsandbox/model/text_covid_symptom_annotation_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_covid_symptom_annotation import TextCovidSymptomAnnotation @@ -62,7 +65,14 @@ class TextCovidSymptomAnnotationResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'text_covid_symptom_annotations': 'textCovidSymptomAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_covid_symptom_annotations, *args, **kwargs): # noqa: E501 + """TextCovidSymptomAnnotationResponse - a model defined in OpenAPI + + Args: + text_covid_symptom_annotations ([TextCovidSymptomAnnotation]): A list of COVID symptom annotations + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_covid_symptom_annotations = text_covid_symptom_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, text_covid_symptom_annotations, *args, **kwargs): # noqa: E5 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_date_annotation.py b/nlpsandbox/model/text_date_annotation.py index cab4ac27..d226cd6f 100644 --- a/nlpsandbox/model/text_date_annotation.py +++ b/nlpsandbox/model/text_date_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_annotation import TextAnnotation @@ -111,6 +114,102 @@ def discriminator(): 'date_format': 'dateFormat', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextDateAnnotation - a model defined in OpenAPI + + Keyword Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + date_format (str): Date format (ISO 8601). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -124,16 +223,14 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, start, length, text, confidence, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """TextDateAnnotation - a model defined in OpenAPI - Args: + Keyword Args: start (int): The position of the first character length (int): The length of the annotation text (str): The string annotated confidence (float): The confidence in the accuracy of the annotation - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -197,39 +294,31 @@ def __init__(self, start, length, text, confidence, *args, **kwargs): # noqa: E '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'start': start, - 'length': length, - 'text': text, - 'confidence': confidence, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/text_date_annotation_all_of.py b/nlpsandbox/model/text_date_annotation_all_of.py index 1854288f..19e6b48e 100644 --- a/nlpsandbox/model/text_date_annotation_all_of.py +++ b/nlpsandbox/model/text_date_annotation_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class TextDateAnnotationAllOf(ModelNormal): @@ -58,7 +61,13 @@ class TextDateAnnotationAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -85,8 +94,85 @@ def discriminator(): 'date_format': 'dateFormat', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextDateAnnotationAllOf - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + date_format (str): Date format (ISO 8601). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -165,3 +251,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_date_annotation_request.py b/nlpsandbox/model/text_date_annotation_request.py index 0462242f..1c014bab 100644 --- a/nlpsandbox/model/text_date_annotation_request.py +++ b/nlpsandbox/model/text_date_annotation_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -62,7 +65,14 @@ class TextDateAnnotationRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'note': 'note', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, *args, **kwargs): # noqa: E501 + """TextDateAnnotationRequest - a model defined in OpenAPI + + Args: + note (Note): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, note, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_date_annotation_response.py b/nlpsandbox/model/text_date_annotation_response.py index 18763004..e42bc71e 100644 --- a/nlpsandbox/model/text_date_annotation_response.py +++ b/nlpsandbox/model/text_date_annotation_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_date_annotation import TextDateAnnotation @@ -62,7 +65,14 @@ class TextDateAnnotationResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'text_date_annotations': 'textDateAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_date_annotations, *args, **kwargs): # noqa: E501 + """TextDateAnnotationResponse - a model defined in OpenAPI + + Args: + text_date_annotations ([TextDateAnnotation]): A list of date annotations + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_date_annotations = text_date_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, text_date_annotations, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_id_annotation.py b/nlpsandbox/model/text_id_annotation.py index 7b355218..de2cd160 100644 --- a/nlpsandbox/model/text_id_annotation.py +++ b/nlpsandbox/model/text_id_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_annotation import TextAnnotation @@ -123,6 +126,102 @@ def discriminator(): 'id_type': 'idType', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextIdAnnotation - a model defined in OpenAPI + + Keyword Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + id_type (str): Type of ID information + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -136,17 +235,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, start, length, text, confidence, id_type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """TextIdAnnotation - a model defined in OpenAPI - Args: + Keyword Args: start (int): The position of the first character length (int): The length of the annotation text (str): The string annotated confidence (float): The confidence in the accuracy of the annotation id_type (str): Type of ID information - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -209,40 +306,31 @@ def __init__(self, start, length, text, confidence, id_type, *args, **kwargs): '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'start': start, - 'length': length, - 'text': text, - 'confidence': confidence, - 'id_type': id_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/text_id_annotation_all_of.py b/nlpsandbox/model/text_id_annotation_all_of.py index 1342ff9a..b7972148 100644 --- a/nlpsandbox/model/text_id_annotation_all_of.py +++ b/nlpsandbox/model/text_id_annotation_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class TextIdAnnotationAllOf(ModelNormal): @@ -70,7 +73,13 @@ class TextIdAnnotationAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -97,8 +106,88 @@ def discriminator(): 'id_type': 'idType', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id_type, *args, **kwargs): # noqa: E501 + """TextIdAnnotationAllOf - a model defined in OpenAPI + + Args: + id_type (str): Type of ID information + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id_type = id_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -180,3 +269,6 @@ def __init__(self, id_type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_id_annotation_request.py b/nlpsandbox/model/text_id_annotation_request.py index ec38526d..30c01281 100644 --- a/nlpsandbox/model/text_id_annotation_request.py +++ b/nlpsandbox/model/text_id_annotation_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -62,7 +65,14 @@ class TextIdAnnotationRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'note': 'note', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, *args, **kwargs): # noqa: E501 + """TextIdAnnotationRequest - a model defined in OpenAPI + + Args: + note (Note): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, note, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_id_annotation_response.py b/nlpsandbox/model/text_id_annotation_response.py index 549468a9..47d3aa00 100644 --- a/nlpsandbox/model/text_id_annotation_response.py +++ b/nlpsandbox/model/text_id_annotation_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_id_annotation import TextIdAnnotation @@ -62,7 +65,14 @@ class TextIdAnnotationResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'text_id_annotations': 'textIdAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_id_annotations, *args, **kwargs): # noqa: E501 + """TextIdAnnotationResponse - a model defined in OpenAPI + + Args: + text_id_annotations ([TextIdAnnotation]): A list of ID annotations + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_id_annotations = text_id_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, text_id_annotations, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_physical_address_annotation.py b/nlpsandbox/model/text_location_annotation.py similarity index 59% rename from nlpsandbox/model/text_physical_address_annotation.py rename to nlpsandbox/model/text_location_annotation.py index 5aee73b5..7dc406f4 100644 --- a/nlpsandbox/model/text_physical_address_annotation.py +++ b/nlpsandbox/model/text_location_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,15 +26,18 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_annotation import TextAnnotation - from nlpsandbox.model.text_physical_address_annotation_all_of import TextPhysicalAddressAnnotationAllOf + from nlpsandbox.model.text_location_annotation_all_of import TextLocationAnnotationAllOf globals()['TextAnnotation'] = TextAnnotation - globals()['TextPhysicalAddressAnnotationAllOf'] = TextPhysicalAddressAnnotationAllOf + globals()['TextLocationAnnotationAllOf'] = TextLocationAnnotationAllOf -class TextPhysicalAddressAnnotation(ModelComposed): +class TextLocationAnnotation(ModelComposed): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,7 +62,7 @@ class TextPhysicalAddressAnnotation(ModelComposed): """ allowed_values = { - ('address_type',): { + ('location_type',): { 'CITY': "city", 'COUNTRY': "country", 'DEPARTMENT': "department", @@ -107,7 +110,7 @@ def openapi_types(): 'length': (int,), # noqa: E501 'text': (str,), # noqa: E501 'confidence': (float,), # noqa: E501 - 'address_type': (str,), # noqa: E501 + 'location_type': (str,), # noqa: E501 } @cached_property @@ -120,9 +123,105 @@ def discriminator(): 'length': 'length', # noqa: E501 'text': 'text', # noqa: E501 'confidence': 'confidence', # noqa: E501 - 'address_type': 'addressType', # noqa: E501 + 'location_type': 'locationType', # noqa: E501 + } + + read_only_vars = { } + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextLocationAnnotation - a model defined in OpenAPI + + Keyword Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + location_type (str): Type of location + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -136,17 +235,15 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, start, length, text, confidence, address_type, *args, **kwargs): # noqa: E501 - """TextPhysicalAddressAnnotation - a model defined in OpenAPI + def __init__(self, *args, **kwargs): # noqa: E501 + """TextLocationAnnotation - a model defined in OpenAPI - Args: + Keyword Args: start (int): The position of the first character length (int): The length of the annotation text (str): The string annotated confidence (float): The confidence in the accuracy of the annotation - address_type (str): Type of address information - - Keyword Args: + location_type (str): Type of location _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -209,40 +306,31 @@ def __init__(self, start, length, text, confidence, address_type, *args, **kwarg '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'start': start, - 'length': length, - 'text': text, - 'confidence': confidence, - 'address_type': address_type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading @@ -252,7 +340,7 @@ def _composed_schemas(): ], 'allOf': [ TextAnnotation, - TextPhysicalAddressAnnotationAllOf, + TextLocationAnnotationAllOf, ], 'oneOf': [ ], diff --git a/nlpsandbox/model/text_physical_address_annotation_all_of.py b/nlpsandbox/model/text_location_annotation_all_of.py similarity index 55% rename from nlpsandbox/model/text_physical_address_annotation_all_of.py rename to nlpsandbox/model/text_location_annotation_all_of.py index 971a9f18..25f1ffc9 100644 --- a/nlpsandbox/model/text_physical_address_annotation_all_of.py +++ b/nlpsandbox/model/text_location_annotation_all_of.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,9 +26,12 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError -class TextPhysicalAddressAnnotationAllOf(ModelNormal): + +class TextLocationAnnotationAllOf(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -53,7 +56,7 @@ class TextPhysicalAddressAnnotationAllOf(ModelNormal): """ allowed_values = { - ('address_type',): { + ('location_type',): { 'CITY': "city", 'COUNTRY': "country", 'DEPARTMENT': "department", @@ -70,7 +73,13 @@ class TextPhysicalAddressAnnotationAllOf(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -85,7 +94,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'address_type': (str,), # noqa: E501 + 'location_type': (str,), # noqa: E501 } @cached_property @@ -94,11 +103,91 @@ def discriminator(): attribute_map = { - 'address_type': 'addressType', # noqa: E501 + 'location_type': 'locationType', # noqa: E501 + } + + read_only_vars = { } _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, location_type, *args, **kwargs): # noqa: E501 + """TextLocationAnnotationAllOf - a model defined in OpenAPI + + Args: + location_type (str): Type of location + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.location_type = location_type + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -109,11 +198,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, address_type, *args, **kwargs): # noqa: E501 - """TextPhysicalAddressAnnotationAllOf - a model defined in OpenAPI + def __init__(self, location_type, *args, **kwargs): # noqa: E501 + """TextLocationAnnotationAllOf - a model defined in OpenAPI Args: - address_type (str): Type of address information + location_type (str): Type of location Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -171,7 +260,7 @@ def __init__(self, address_type, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.address_type = address_type + self.location_type = location_type for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ @@ -180,3 +269,6 @@ def __init__(self, address_type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_physical_address_annotation_request.py b/nlpsandbox/model/text_location_annotation_request.py similarity index 56% rename from nlpsandbox/model/text_physical_address_annotation_request.py rename to nlpsandbox/model/text_location_annotation_request.py index 474799d3..148e5843 100644 --- a/nlpsandbox/model/text_physical_address_annotation_request.py +++ b/nlpsandbox/model/text_location_annotation_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,13 +26,16 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note globals()['Note'] = Note -class TextPhysicalAddressAnnotationRequest(ModelNormal): +class TextLocationAnnotationRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -62,7 +65,14 @@ class TextPhysicalAddressAnnotationRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'note': 'note', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, *args, **kwargs): # noqa: E501 + """TextLocationAnnotationRequest - a model defined in OpenAPI + + Args: + note (Note): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -103,7 +193,7 @@ def discriminator(): @convert_js_args_to_python_args def __init__(self, note, *args, **kwargs): # noqa: E501 - """TextPhysicalAddressAnnotationRequest - a model defined in OpenAPI + """TextLocationAnnotationRequest - a model defined in OpenAPI Args: note (Note): @@ -173,3 +263,6 @@ def __init__(self, note, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_physical_address_annotation_response.py b/nlpsandbox/model/text_location_annotation_response.py similarity index 52% rename from nlpsandbox/model/text_physical_address_annotation_response.py rename to nlpsandbox/model/text_location_annotation_response.py index f25f8048..067b7f98 100644 --- a/nlpsandbox/model/text_physical_address_annotation_response.py +++ b/nlpsandbox/model/text_location_annotation_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,13 +26,16 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): - from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation - globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation + from nlpsandbox.model.text_location_annotation import TextLocationAnnotation + globals()['TextLocationAnnotation'] = TextLocationAnnotation -class TextPhysicalAddressAnnotationResponse(ModelNormal): +class TextLocationAnnotationResponse(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -62,7 +65,14 @@ class TextPhysicalAddressAnnotationResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -78,7 +88,7 @@ def openapi_types(): """ lazy_import() return { - 'text_physical_address_annotations': ([TextPhysicalAddressAnnotation],), # noqa: E501 + 'text_location_annotations': ([TextLocationAnnotation],), # noqa: E501 } @cached_property @@ -87,11 +97,91 @@ def discriminator(): attribute_map = { - 'text_physical_address_annotations': 'textPhysicalAddressAnnotations', # noqa: E501 + 'text_location_annotations': 'textLocationAnnotations', # noqa: E501 + } + + read_only_vars = { } _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_location_annotations, *args, **kwargs): # noqa: E501 + """TextLocationAnnotationResponse - a model defined in OpenAPI + + Args: + text_location_annotations ([TextLocationAnnotation]): A list of location annotations + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_location_annotations = text_location_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -102,11 +192,11 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, text_physical_address_annotations, *args, **kwargs): # noqa: E501 - """TextPhysicalAddressAnnotationResponse - a model defined in OpenAPI + def __init__(self, text_location_annotations, *args, **kwargs): # noqa: E501 + """TextLocationAnnotationResponse - a model defined in OpenAPI Args: - text_physical_address_annotations ([TextPhysicalAddressAnnotation]): A list of physical address annotations + text_location_annotations ([TextLocationAnnotation]): A list of location annotations Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -164,7 +254,7 @@ def __init__(self, text_physical_address_annotations, *args, **kwargs): # noqa: self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.text_physical_address_annotations = text_physical_address_annotations + self.text_location_annotations = text_location_annotations for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ @@ -173,3 +263,6 @@ def __init__(self, text_physical_address_annotations, *args, **kwargs): # noqa: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_person_name_annotation.py b/nlpsandbox/model/text_person_name_annotation.py index b6c10218..e771cdbb 100644 --- a/nlpsandbox/model/text_person_name_annotation.py +++ b/nlpsandbox/model/text_person_name_annotation.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_annotation import TextAnnotation @@ -107,6 +110,101 @@ def discriminator(): 'confidence': 'confidence', # noqa: E501 } + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TextPersonNameAnnotation - a model defined in OpenAPI + + Keyword Args: + start (int): The position of the first character + length (int): The length of the annotation + text (str): The string annotated + confidence (float): The confidence in the accuracy of the annotation + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set([ '_data_store', '_check_type', @@ -120,16 +218,14 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, start, length, text, confidence, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """TextPersonNameAnnotation - a model defined in OpenAPI - Args: + Keyword Args: start (int): The position of the first character length (int): The length of the annotation text (str): The string annotated confidence (float): The confidence in the accuracy of the annotation - - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -192,39 +288,31 @@ def __init__(self, start, length, text, confidence, *args, **kwargs): # noqa: E '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } - required_args = { - 'start': start, - 'length': length, - 'text': text, - 'confidence': confidence, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) composed_info = validate_get_composed_info( - constant_args, model_args, self) + constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): - if var_name in unused_args and \ + if var_name in discarded_args and \ self._configuration is not None and \ self._configuration.discard_unknown_keys and \ - not self._additional_properties_model_instances: + self._additional_properties_model_instances: # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") @cached_property def _composed_schemas(): # we need this here to make our import statements work # we must store _composed_schemas in here so the code is only run # when we invoke this method. If we kept this at the class - # level we would get an error beause the class level + # level we would get an error because the class level # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading diff --git a/nlpsandbox/model/text_person_name_annotation_request.py b/nlpsandbox/model/text_person_name_annotation_request.py index ab1c124f..591a93b7 100644 --- a/nlpsandbox/model/text_person_name_annotation_request.py +++ b/nlpsandbox/model/text_person_name_annotation_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.note import Note @@ -62,7 +65,14 @@ class TextPersonNameAnnotationRequest(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'note': 'note', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, note, *args, **kwargs): # noqa: E501 + """TextPersonNameAnnotationRequest - a model defined in OpenAPI + + Args: + note (Note): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.note = note + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, note, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/text_person_name_annotation_response.py b/nlpsandbox/model/text_person_name_annotation_response.py index 6728c06f..7bb850e9 100644 --- a/nlpsandbox/model/text_person_name_annotation_response.py +++ b/nlpsandbox/model/text_person_name_annotation_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation @@ -62,7 +65,14 @@ class TextPersonNameAnnotationResponse(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'text_person_name_annotations': 'textPersonNameAnnotations', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text_person_name_annotations, *args, **kwargs): # noqa: E501 + """TextPersonNameAnnotationResponse - a model defined in OpenAPI + + Args: + text_person_name_annotations ([TextPersonNameAnnotation]): A list of person name annotations + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text_person_name_annotations = text_person_name_annotations + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, text_person_name_annotations, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/tool.py b/nlpsandbox/model/tool.py index edb299af..f1eb1d21 100644 --- a/nlpsandbox/model/tool.py +++ b/nlpsandbox/model/tool.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,11 +26,16 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.license import License + from nlpsandbox.model.programming_language import ProgrammingLanguage from nlpsandbox.model.tool_type import ToolType globals()['License'] = License + globals()['ProgrammingLanguage'] = ProgrammingLanguage globals()['ToolType'] = ToolType @@ -76,7 +81,7 @@ class Tool(ModelNormal): }, }, ('description',): { - 'max_length': 100, + 'max_length': 280, }, ('api_version',): { 'min_length': 1, @@ -84,9 +89,19 @@ class Tool(ModelNormal): 'pattern': r'^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$', # noqa: E501 }, }, + ('programming_languages',): { + 'min_items': 0, + }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -112,6 +127,7 @@ def openapi_types(): 'url': (str,), # noqa: E501 'type': (ToolType,), # noqa: E501 'api_version': (str,), # noqa: E501 + 'programming_languages': ([ProgrammingLanguage],), # noqa: E501 } @cached_property @@ -130,10 +146,110 @@ def discriminator(): 'url': 'url', # noqa: E501 'type': 'type', # noqa: E501 'api_version': 'apiVersion', # noqa: E501 + 'programming_languages': 'programmingLanguages', # noqa: E501 + } + + read_only_vars = { } _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, version, license, repository, description, author, author_email, url, type, api_version, *args, **kwargs): # noqa: E501 + """Tool - a model defined in OpenAPI + + Args: + name (str): The tool name + version (str): The version of the tool (SemVer string) + license (License): + repository (str): The place where the code lives + description (str): A short, one-sentence summary of the tool + author (str): The author of the tool + author_email (str): The email address of the author + url (str): The URL to the homepage of the tool + type (ToolType): + api_version (str): The version of the tool OpenAPI specification + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + programming_languages ([ProgrammingLanguage]): The programming languages used to develop this tool. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.version = version + self.license = license + self.repository = repository + self.description = description + self.author = author + self.author_email = author_email + self.url = url + self.type = type + self.api_version = api_version + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -190,6 +306,7 @@ def __init__(self, name, version, license, repository, description, author, auth Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + programming_languages ([ProgrammingLanguage]): The programming languages used to develop this tool. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -233,3 +350,6 @@ def __init__(self, name, version, license, repository, description, author, auth # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/tool_dependencies.py b/nlpsandbox/model/tool_dependencies.py index 8716f791..9d77d2f0 100644 --- a/nlpsandbox/model/tool_dependencies.py +++ b/nlpsandbox/model/tool_dependencies.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + def lazy_import(): from nlpsandbox.model.tool import Tool @@ -62,7 +65,14 @@ class ToolDependencies(ModelNormal): validations = { } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -90,8 +100,88 @@ def discriminator(): 'tools': 'tools', # noqa: E501 } + read_only_vars = { + } + _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, tools, *args, **kwargs): # noqa: E501 + """ToolDependencies - a model defined in OpenAPI + + Args: + tools ([Tool]): A list of tools + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.tools = tools + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set([ '_data_store', '_check_type', @@ -173,3 +263,6 @@ def __init__(self, tools, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/nlpsandbox/model/tool_type.py b/nlpsandbox/model/tool_type.py index e9912493..bbfa0481 100644 --- a/nlpsandbox/model/tool_type.py +++ b/nlpsandbox/model/tool_type.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -26,6 +26,9 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from nlpsandbox.exceptions import ApiAttributeError + class ToolType(ModelSimple): @@ -49,16 +52,20 @@ class ToolType(ModelSimple): """ allowed_values = { + ('value',): { + 'CONTACT-ANNOTATOR': "nlpsandbox:contact-annotator", + 'COVID-SYMPTOM-ANNOTATOR': "nlpsandbox:covid-symptom-annotator", + 'DATA-NODE': "nlpsandbox:data-node", + 'DATE-ANNOTATOR': "nlpsandbox:date-annotator", + 'ID-ANNOTATOR': "nlpsandbox:id-annotator", + 'LOCATION-ANNOTATOR': "nlpsandbox:location-annotator", + 'PERSON-NAME-ANNOTATOR': "nlpsandbox:person-name-annotator", + 'PHI-ANNOTATOR': "nlpsandbox:phi-annotator", + 'PHI-DEIDENTIFIER': "nlpsandbox:phi-deidentifier", + }, } validations = { - ('value',): { - 'max_length': 60, - 'min_length': 3, - 'regex': { - 'pattern': r'', # noqa: E501 - }, - }, } additional_properties_type = None @@ -86,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set([ @@ -104,10 +113,100 @@ def __init__(self, *args, **kwargs): Note that value can be passed either in args or in kwargs, but not in both. Args: - args[0] (str): The type of this tool. # noqa: E501 + args[0] (str): The type of this tool., must be one of ["nlpsandbox:contact-annotator", "nlpsandbox:covid-symptom-annotator", "nlpsandbox:data-node", "nlpsandbox:date-annotator", "nlpsandbox:id-annotator", "nlpsandbox:location-annotator", "nlpsandbox:person-name-annotator", "nlpsandbox:phi-annotator", "nlpsandbox:phi-deidentifier", ] # noqa: E501 + + Keyword Args: + value (str): The type of this tool., must be one of ["nlpsandbox:contact-annotator", "nlpsandbox:covid-symptom-annotator", "nlpsandbox:data-node", "nlpsandbox:date-annotator", "nlpsandbox:id-annotator", "nlpsandbox:location-annotator", "nlpsandbox:person-name-annotator", "nlpsandbox:phi-annotator", "nlpsandbox:phi-deidentifier", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ToolType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of this tool., must be one of ["nlpsandbox:contact-annotator", "nlpsandbox:covid-symptom-annotator", "nlpsandbox:data-node", "nlpsandbox:date-annotator", "nlpsandbox:id-annotator", "nlpsandbox:location-annotator", "nlpsandbox:person-name-annotator", "nlpsandbox:phi-annotator", "nlpsandbox:phi-deidentifier", ] # noqa: E501 Keyword Args: - value (str): The type of this tool. # noqa: E501 + value (str): The type of this tool., must be one of ["nlpsandbox:contact-annotator", "nlpsandbox:covid-symptom-annotator", "nlpsandbox:data-node", "nlpsandbox:date-annotator", "nlpsandbox:id-annotator", "nlpsandbox:location-annotator", "nlpsandbox:person-name-annotator", "nlpsandbox:phi-annotator", "nlpsandbox:phi-deidentifier", ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -142,6 +241,8 @@ def __init__(self, *args, **kwargs): # required up here when default value is not given _path_to_item = kwargs.pop('_path_to_item', ()) + self = super(OpenApiModel, cls).__new__(cls) + if 'value' in kwargs: value = kwargs.pop('value') elif args: @@ -185,3 +286,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/nlpsandbox/model_utils.py b/nlpsandbox/model_utils.py index 4fc90ce1..92bab5fa 100644 --- a/nlpsandbox/model_utils.py +++ b/nlpsandbox/model_utils.py @@ -3,13 +3,14 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ from datetime import date, datetime # noqa: F401 +from copy import deepcopy import inspect import io import os @@ -30,9 +31,25 @@ file_type = io.IOBase +def convert_js_args_to_python_args(fn): + from functools import wraps + @wraps(fn) + def wrapped_init(_self, *args, **kwargs): + """ + An attribute named `self` received from the api will conflicts with the reserved `self` + parameter of a class method. During generation, `self` attributes are mapped + to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. + """ + spec_property_naming = kwargs.get('_spec_property_naming', False) + if spec_property_naming: + kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) + return fn(_self, *args, **kwargs) + return wrapped_init + + class cached_property(object): # this caches the result of the function call for fn with no inputs - # use this as a decorator on fuction methods that you want converted + # use this as a decorator on function methods that you want converted # into cached properties result_key = '_results' @@ -171,6 +188,26 @@ def __getattr__(self, attr): """get the value of an attribute using dot notation: `instance.attr`""" return self.__getitem__(attr) + def __copy__(self): + cls = self.__class__ + if self.get("_spec_property_naming", False): + return cls._new_from_openapi_data(**self.__dict__) + else: + return new_cls.__new__(cls, **self.__dict__) + + def __deepcopy__(self, memo): + cls = self.__class__ + + if self.get("_spec_property_naming", False): + new_inst = cls._new_from_openapi_data() + else: + new_inst = cls.__new__(cls) + + for k, v in self.__dict__.items(): + setattr(new_inst, k, deepcopy(v, memo)) + return new_inst + + def __new__(cls, *args, **kwargs): # this function uses the discriminator to # pick a new schema/class to instantiate because a discriminator @@ -280,8 +317,128 @@ def __new__(cls, *args, **kwargs): self_inst = super(OpenApiModel, cls).__new__(cls) self_inst.__init__(*args, **kwargs) - new_inst = new_cls.__new__(new_cls, *args, **kwargs) - new_inst.__init__(*args, **kwargs) + if kwargs.get("_spec_property_naming", False): + # when true, implies new is from deserialization + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) + else: + new_inst = new_cls.__new__(new_cls, *args, **kwargs) + new_inst.__init__(*args, **kwargs) + + return new_inst + + + @classmethod + @convert_js_args_to_python_args + def _new_from_openapi_data(cls, *args, **kwargs): + # this function uses the discriminator to + # pick a new schema/class to instantiate because a discriminator + # propertyName value was passed in + + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + + + visited_composed_classes = kwargs.get('_visited_composed_classes', ()) + if ( + cls.discriminator is None or + cls in visited_composed_classes + ): + # Use case 1: this openapi schema (cls) does not have a discriminator + # Use case 2: we have already visited this class before and are sure that we + # want to instantiate it this time. We have visited this class deserializing + # a payload with a discriminator. During that process we traveled through + # this class but did not make an instance of it. Now we are making an + # instance of a composed class which contains cls in it, so this time make an instance of cls. + # + # Here's an example of use case 2: If Animal has a discriminator + # petType and we pass in "Dog", and the class Dog + # allOf includes Animal, we move through Animal + # once using the discriminator, and pick Dog. + # Then in the composed schema dog Dog, we will make an instance of the + # Animal class (because Dal has allOf: Animal) but this time we won't travel + # through Animal's discriminator because we passed in + # _visited_composed_classes = (Animal,) + + return cls._from_openapi_data(*args, **kwargs) + + # Get the name and value of the discriminator property. + # The discriminator name is obtained from the discriminator meta-data + # and the discriminator value is obtained from the input data. + discr_propertyname_py = list(cls.discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if discr_propertyname_js in kwargs: + discr_value = kwargs[discr_propertyname_js] + elif discr_propertyname_py in kwargs: + discr_value = kwargs[discr_propertyname_py] + else: + # The input data does not contain the discriminator property. + path_to_item = kwargs.get('_path_to_item', ()) + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '%s' is missing at path: %s" % + (discr_propertyname_js, path_to_item) + ) + + # Implementation note: the last argument to get_discriminator_class + # is a list of visited classes. get_discriminator_class may recursively + # call itself and update the list of visited classes, and the initial + # value must be an empty list. Hence not using 'visited_composed_classes' + new_cls = get_discriminator_class( + cls, discr_propertyname_py, discr_value, []) + if new_cls is None: + path_to_item = kwargs.get('_path_to_item', ()) + disc_prop_value = kwargs.get( + discr_propertyname_js, kwargs.get(discr_propertyname_py)) + raise ApiValueError( + "Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '%s'='%s' at path: %s" % + (discr_propertyname_js, disc_prop_value, path_to_item) + ) + + if new_cls in visited_composed_classes: + # if we are making an instance of a composed schema Descendent + # which allOf includes Ancestor, then Ancestor contains + # a discriminator that includes Descendent. + # So if we make an instance of Descendent, we have to make an + # instance of Ancestor to hold the allOf properties. + # This code detects that use case and makes the instance of Ancestor + # For example: + # When making an instance of Dog, _visited_composed_classes = (Dog,) + # then we make an instance of Animal to include in dog._composed_instances + # so when we are here, cls is Animal + # cls.discriminator != None + # cls not in _visited_composed_classes + # new_cls = Dog + # but we know we know that we already have Dog + # because it is in visited_composed_classes + # so make Animal here + return cls._from_openapi_data(*args, **kwargs) + + # Build a list containing all oneOf and anyOf descendants. + oneof_anyof_classes = None + if cls._composed_schemas is not None: + oneof_anyof_classes = ( + cls._composed_schemas.get('oneOf', ()) + + cls._composed_schemas.get('anyOf', ())) + oneof_anyof_child = new_cls in oneof_anyof_classes + kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + + if cls._composed_schemas.get('allOf') and oneof_anyof_child: + # Validate that we can make self because when we make the + # new_cls it will not include the allOf validations in self + self_inst = cls._from_openapi_data(*args, **kwargs) + + + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) return new_inst @@ -316,7 +473,7 @@ def __getitem__(self, name): ) def __contains__(self, name): - """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" + """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" if name in self.required_properties: return name in self.__dict__ @@ -371,7 +528,7 @@ def __getitem__(self, name): ) def __contains__(self, name): - """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" + """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" if name in self.required_properties: return name in self.__dict__ @@ -435,27 +592,43 @@ def __setitem__(self, name, value): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format( + type(self).__name__, name), + [e for e in [self._path_to_item, name] if e] + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -465,13 +638,12 @@ def get(self, name, default=None): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -503,7 +675,7 @@ def __getitem__(self, name): return value def __contains__(self, name): - """used by `in` operator to check if an attrbute value was set in an instance: `'attr' in instance`""" + """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`""" if name in self.required_properties: return name in self.__dict__ @@ -1194,14 +1366,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): - return model_class(model_data, **kw_args) + return model_class._new_from_openapi_data(model_data, **kw_args) elif isinstance(model_data, list): - return model_class(*model_data, **kw_args) + return model_class._new_from_openapi_data(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - return model_class(**kw_args) + return model_class._new_from_openapi_data(**kw_args) elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class(model_data, **kw_args) + return model_class._new_from_openapi_data(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1334,6 +1506,9 @@ def is_valid_type(input_class_simple, valid_classes): Returns: bool """ + if issubclass(input_class_simple, OpenApiModel) and \ + valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,): + return True valid_type = input_class_simple in valid_classes if not valid_type and ( issubclass(input_class_simple, OpenApiModel) or @@ -1487,12 +1662,20 @@ def model_to_dict(model_instance, serialize=True): model_instances = [model_instance] if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) + seen_json_attribute_names = set() + used_fallback_python_attribute_names = set() + py_to_json_map = {} for model_instance in model_instances: for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map - attr = model_instance.attribute_map.get(attr, attr) + try: + attr = model_instance.attribute_map[attr] + py_to_json_map.update(model_instance.attribute_map) + seen_json_attribute_names.add(attr) + except KeyError: + used_fallback_python_attribute_names.add(attr) if isinstance(value, list): if not value: # empty list or None @@ -1520,6 +1703,16 @@ def model_to_dict(model_instance, serialize=True): result[attr] = model_to_dict(value, serialize=serialize) else: result[attr] = value + if serialize: + for python_key in used_fallback_python_attribute_names: + json_key = py_to_json_map.get(python_key) + if json_key is None: + continue + if python_key == json_key: + continue + json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names + if json_key_assigned_no_need_for_python_key: + del result[python_key] return result @@ -1563,30 +1756,19 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def convert_js_args_to_python_args(fn): - from functools import wraps - @wraps(fn) - def wrapped_init(_self, *args, **kwargs): - """ - An attribute named `self` received from the api will conflicts with the reserved `self` - parameter of a class method. During generation, `self` attributes are mapped - to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. - """ - spec_property_naming = kwargs.get('_spec_property_naming', False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, _self.__class__) - return fn(_self, *args, **kwargs) - return wrapped_init - - def get_allof_instances(self, model_args, constant_args): """ Args: self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1594,20 +1776,11 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas['allOf']: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + if constant_args.get('_spec_property_naming'): + allof_instance = allof_class._from_openapi_data(**model_args, **constant_args) + else: + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1667,34 +1840,18 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + if constant_kwargs.get('_spec_property_naming'): + oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs) + else: + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): - oneof_instance = oneof_class(model_arg, **constant_kwargs) + if constant_kwargs.get('_spec_property_naming'): + oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs) + else: + oneof_instance = oneof_class(model_arg, **constant_kwargs) elif oneof_class in PRIMITIVE_TYPES: oneof_instance = validate_and_convert_types( model_arg, @@ -1748,24 +1905,11 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + if constant_args.get('_spec_property_naming'): + anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args) + else: + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1778,47 +1922,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas['allOf']: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1862,36 +1993,42 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) - ) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances return [ composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + discarded_args ] diff --git a/nlpsandbox/models/__init__.py b/nlpsandbox/models/__init__.py index 204e7282..b836d32a 100644 --- a/nlpsandbox/models/__init__.py +++ b/nlpsandbox/models/__init__.py @@ -60,6 +60,7 @@ from nlpsandbox.model.patient_create_response import PatientCreateResponse from nlpsandbox.model.patient_id import PatientId from nlpsandbox.model.patient_resource_name import PatientResourceName +from nlpsandbox.model.programming_language import ProgrammingLanguage from nlpsandbox.model.resource_source import ResourceSource from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks @@ -80,13 +81,13 @@ from nlpsandbox.model.text_id_annotation_all_of import TextIdAnnotationAllOf from nlpsandbox.model.text_id_annotation_request import TextIdAnnotationRequest from nlpsandbox.model.text_id_annotation_response import TextIdAnnotationResponse +from nlpsandbox.model.text_location_annotation import TextLocationAnnotation +from nlpsandbox.model.text_location_annotation_all_of import TextLocationAnnotationAllOf +from nlpsandbox.model.text_location_annotation_request import TextLocationAnnotationRequest +from nlpsandbox.model.text_location_annotation_response import TextLocationAnnotationResponse from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation from nlpsandbox.model.text_person_name_annotation_request import TextPersonNameAnnotationRequest from nlpsandbox.model.text_person_name_annotation_response import TextPersonNameAnnotationResponse -from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation -from nlpsandbox.model.text_physical_address_annotation_all_of import TextPhysicalAddressAnnotationAllOf -from nlpsandbox.model.text_physical_address_annotation_request import TextPhysicalAddressAnnotationRequest -from nlpsandbox.model.text_physical_address_annotation_response import TextPhysicalAddressAnnotationResponse from nlpsandbox.model.tool import Tool from nlpsandbox.model.tool_dependencies import ToolDependencies from nlpsandbox.model.tool_type import ToolType diff --git a/nlpsandbox/rest.py b/nlpsandbox/rest.py index c91764d2..5b28eaf0 100644 --- a/nlpsandbox/rest.py +++ b/nlpsandbox/rest.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.2 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -138,15 +138,15 @@ def request(self, method, url, query_params=None, headers=None, timeout = urllib3.Timeout( connect=_request_timeout[0], read=_request_timeout[1]) - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests + if (method != 'DELETE') and ('Content-Type' not in headers): + headers['Content-Type'] = 'application/json' if query_params: url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): + if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): request_body = None if body is not None: request_body = json.dumps(body) diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 00000000..3b40e47a --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "5.3.0" + } +} diff --git a/test/client/__init__.py b/test/client/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/test/client/test_client.py b/test/client/test_client.py deleted file mode 100644 index 42123c6f..00000000 --- a/test/client/test_client.py +++ /dev/null @@ -1,542 +0,0 @@ -"""Test client functions""" -from unittest.mock import Mock, patch - -import pytest - -import nlpsandbox -from nlpsandbox.api import ( - annotation_api, annotation_store_api, - dataset_api, note_api, - text_contact_annotation_api, - text_covid_symptom_annotation_api, - text_date_annotation_api, - text_id_annotation_api, - text_person_name_annotation_api, - text_physical_address_annotation_api, - tool_api, -) -from nlpsandbox.models import ( - Annotation, AnnotationName, AnnotationSource, - AnnotationStore, AnnotationStoreName, Dataset, DatasetName, - License, PageLimit, PageOfAnnotations, PageOfDatasets, - PageOfNotes, PageOffset, PatientId, Note, NoteId, - TextDateAnnotation, TextDateAnnotationResponse, Tool, - ToolType, ResourceSource, ResponsePageMetadataLinks, -) -from nlpsandbox.rest import ApiException -from nlpsandboxclient import client - - -# def test_get_notes(): -# configuration = Mock() -# api = Mock() -# note_api_mock = Mock() -# host = "0.0.0.0" -# configuration = Mock() -# note_example = PageOfNotes( -# notes=[Note( -# id="12344", type="foo", patient_id="pat1", text="foobarbaz" -# )], -# offset=0, limit=3, links=Mock(next="") -# ) - -# with patch.object(nlpsandbox, "Configuration", -# return_value=configuration) as config,\ -# patch.object(nlpsandbox, "ApiClient") as api_client,\ -# patch.object(nlpsandbox, "NoteApi", -# return_value=note_api_mock) as note_api,\ -# patch.object(note_api_mock, "list_notes", -# return_value=note_example) as list_notes: - -# # To mock context manager -# api_client.return_value = api_client -# api_client.__enter__ = Mock(return_value=api) -# api_client.__exit__ = Mock(return_value=None) - -# notes = client.get_notes( -# host=host, -# dataset_id="awesome-dataset", -# fhir_store_id="awesome-fhir-store" -# ) -# config.assert_called_once_with(host=host) -# api_client.assert_called_once_with(configuration) -# note_api.assert_called_once_with(api) -# list_notes.assert_called_once_with("awesome-dataset", -# "awesome-fhir-store", -# limit=10, offset=0) -# assert notes == [{ -# 'id': '12344', -# 'noteType': 'foo', -# 'patientId': 'pat1', -# 'text': 'foobarbaz', -# 'note_name': 'dataset/awesome-dataset/fhirStores/awesome-fhir-store/fhir/Note/12344' -# }] - - -class TestDataNodeClient: - - def setup_method(self): - self.configuration = nlpsandbox.Configuration() - self.api = nlpsandbox.ApiClient() - self.mock_api = Mock() - self.host = "0.0.0.0" - self.config = patch.object(nlpsandbox, "Configuration", - return_value=self.configuration) - self.api_client = patch.object(nlpsandbox, "ApiClient") - self.dataset_id = "awesome-dataset" - self.annotation_store_id = "annotation-store" - self.annotation_id = "awesome-annotation" - self.fhir_store_id = "fhir-store" - # To mock context manager - - def test_list_notes(self): - note_example = PageOfNotes( - notes=[ - Note(identifier=NoteId("12344"), type="foo", patient_id=PatientId("pat1"), text="foobarbaz") - ], - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next=""), - total_results=30, - ) - with self.config as config,\ - self.api_client as api_client,\ - patch.object(note_api, "NoteApi", - return_value=self.mock_api) as patch_note_api,\ - patch.object(self.mock_api, "list_notes", - return_value=note_example) as list_notes: - - # To mock context manager - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - notes = list(client.list_notes( - host=self.host, - dataset_id=self.dataset_id, - fhir_store_id=self.fhir_store_id - )) - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - patch_note_api.assert_called_once_with(self.api) - list_notes.assert_called_once_with(self.dataset_id, - self.fhir_store_id, - limit=10, offset=0) - assert notes == [{ - 'identifier': '12344', - 'type': 'foo', - 'patientId': 'pat1', - 'text': 'foobarbaz', - 'note_name': f'dataset/{self.dataset_id}/fhirStores/{self.fhir_store_id}/fhir/Note/12344' - }] - - def test_get_annotation_store__get(self): - """Test getting of annotation store""" - store_example = AnnotationStore(name=AnnotationStoreName("fooo")) - - with self.config as config,\ - self.api_client as api_client,\ - patch.object(annotation_store_api, "AnnotationStoreApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "get_annotation_store", - return_value=store_example) as get_store: - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - store = client.get_annotation_store( - host=self.host, - dataset_id =self.dataset_id, - annotation_store_id = self.fhir_store_id - ) - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - get_store.assert_called_once_with(self.dataset_id, - self.fhir_store_id) - assert store == store_example - - def test_get_annotation_store__not_create(self): - """Test creating of annotation store if create_if_missing is False""" - with self.config as config,\ - self.api_client as api_client,\ - patch.object(annotation_store_api, "AnnotationStoreApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "get_annotation_store", - side_effect=ApiException(status=404)) as get_store,\ - pytest.raises(ApiException): - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - client.get_annotation_store( - host=self.host, - dataset_id = self.dataset_id, - annotation_store_id = self.annotation_store_id, - ) - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - - def test_get_annotation_store__create(self): - """Test creating of annotation store if create_if_missing is True""" - store_example = AnnotationStore(name=AnnotationStoreName("fooo")) - - with self.config as config,\ - self.api_client as api_client,\ - patch.object(annotation_store_api, "AnnotationStoreApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "get_annotation_store", - side_effect=ApiException(status=404)) as get_store,\ - patch.object(self.mock_api, "create_annotation_store", - return_value=store_example) as create_store: - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - store = client.get_annotation_store( - host=self.host, dataset_id = self.dataset_id, - annotation_store_id = self.fhir_store_id, - create_if_missing = True - ) - - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - get_store.assert_called_once_with(self.dataset_id, - self.fhir_store_id) - assert store == store_example - - def test_list_annotations(self): - """Test listing of annotations""" - annotation_example = PageOfAnnotations( - annotations=[ - Annotation( - name=AnnotationName("12344"), - annotation_source=AnnotationSource(resource_source=ResourceSource(name="foo")), - ) - ], - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next=""), - total_results=30 - ) - - with self.config as config,\ - self.api_client as api_client,\ - patch.object(annotation_api, "AnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "list_annotations", - return_value=annotation_example) as list_annotations: - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - annotations = client.list_annotations( - host=self.host, dataset_id = self.dataset_id, - annotation_store_id = self.annotation_store_id - ) - assert list(annotations) == [ - {'name': '12344', 'annotationSource': {'resourceSource': {'name': 'foo'}}} - ] - - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - list_annotations.assert_called_once_with( - self.dataset_id, self.annotation_store_id, - offset=0, limit=10 - ) - - def test_list_datasets(self): - """Test listing of datasets""" - example_datasets = PageOfDatasets( - datasets=[ - Dataset(name=DatasetName("foo")) - ], - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next=""), - total_results=30 - ) - - with self.config as config,\ - self.api_client as api_client,\ - patch.object(dataset_api, "DatasetApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "list_datasets", - return_value=example_datasets) as list_datasets: - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - datasets = client.list_datasets(host=self.host) - assert list(datasets) == [ - {'name': 'foo'} - ] - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - list_datasets.assert_called_once_with(limit=10, offset=0) - - def test_get_annotation(self): - """Test getting of annotation""" - example_annotation = Annotation( - name=AnnotationName("12344"), - annotation_source=AnnotationSource(resource_source=ResourceSource(name="foo")), - ) - with self.config as config,\ - self.api_client as api_client,\ - patch.object(annotation_api, "AnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "get_annotation", - return_value=example_annotation) as get_annotation: - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - annotation = client.get_annotation( - host=self.host, dataset_id=self.dataset_id, - annotation_store_id=self.annotation_store_id, - annotation_id=self.annotation_id - ) - assert annotation == example_annotation - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - get_annotation.assert_called_once_with( - self.dataset_id, self.annotation_store_id, - self.annotation_id - ) - - def test__store_annotations(self): - return_obj = Mock() - example_annotation = Annotation( - name=AnnotationName("12344"), - annotation_source=AnnotationSource(resource_source=ResourceSource(name="foo")), - ) - with self.config as config,\ - self.api_client as api_client,\ - patch.object(annotation_api, "AnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "create_annotation", - return_value=return_obj) as patch_store: - - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - annotation = client._store_annotation( - host=self.host, dataset_id=self.dataset_id, - annotation_store_id=self.annotation_store_id, - annotation_id=self.annotation_id, - annotation=example_annotation - ) - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - resource_api.assert_called_once_with(self.api) - patch_store.assert_called_once_with( - annotation_create_request=example_annotation, - annotation_id='awesome-annotation', - annotation_store_id='annotation-store', - async_req=True, dataset_id='awesome-dataset' - ) - - -class TestAnnotatorClient: - - def setup_method(self): - self.configuration = nlpsandbox.Configuration() - self.api = nlpsandbox.ApiClient() - self.mock_api = Mock() - self.host = "0.0.0.0" - self.config = patch.object(nlpsandbox, "Configuration", - return_value=self.configuration) - self.api_client = patch.object(nlpsandbox, "ApiClient") - self.example_note = { - "identifier": "note-1", - "type": "loinc:LP29684-5", - "patientId": "507f1f77bcf86cd799439011", - "text": "On 12/26/2020, Ms. Chloe Price met with Dr. Prescott." - } - self.example_request = { - "note": { - "identifier": "note-1", - "type": "loinc:LP29684-5", - "patient_id": "507f1f77bcf86cd799439011", - "text": "On 12/26/2020, Ms. Chloe Price met with Dr. Prescott." - } - } - self.date_response = TextDateAnnotationResponse( - text_date_annotations=[ - TextDateAnnotation(start=10, length=10, text="foobar", confidence=95.5) - ] - ) - - def test__annotate_date(self): - """Test annotating date""" - with patch.object(text_date_annotation_api, "TextDateAnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "create_text_date_annotations", - return_value="foo") as create_annotations: - annotated = client._annotate_date(self.api, self.example_request) - assert annotated == "foo" - resource_api.assert_called_once_with(self.api) - create_annotations.assert_called_once_with( - text_date_annotation_request=self.example_request - ) - - def test__annotate_person_name(self): - """Test annotating person""" - with patch.object(text_person_name_annotation_api, "TextPersonNameAnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "create_text_person_name_annotations", - return_value="foo") as create_annotations: - annotated = client._annotate_person_name(self.api, self.example_request) - assert annotated == "foo" - resource_api.assert_called_once_with(self.api) - create_annotations.assert_called_once_with( - text_person_name_annotation_request=self.example_request - ) - - def test__annotate_physical_address(self): - """Test annotating physical address""" - with patch.object(text_physical_address_annotation_api, "TextPhysicalAddressAnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "create_text_physical_address_annotations", - return_value="foo") as create_annotations: - annotated = client._annotate_physical_address(self.api, self.example_request) - assert annotated == "foo" - resource_api.assert_called_once_with(self.api) - create_annotations.assert_called_once_with( - text_physical_address_annotation_request=self.example_request - ) - - def test__annotate_id(self): - """Test annotating id""" - with patch.object(text_id_annotation_api, "TextIdAnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "create_text_id_annotations", - return_value="foo") as create_annotations: - annotated = client._annotate_id(self.api, self.example_request) - assert annotated == "foo" - resource_api.assert_called_once_with(self.api) - create_annotations.assert_called_once_with( - text_id_annotation_request=self.example_request - ) - - def test__annotate_contact(self): - """Test annotating id""" - with patch.object(text_contact_annotation_api, "TextContactAnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "create_text_contact_annotations", - return_value="foo") as create_annotations: - annotated = client._annotate_contact(self.api, self.example_request) - assert annotated == "foo" - resource_api.assert_called_once_with(self.api) - create_annotations.assert_called_once_with( - text_contact_annotation_request=self.example_request - ) - - def test__annotate_covid_symptom(self): - """Test annotating id""" - with patch.object(text_covid_symptom_annotation_api, - "TextCovidSymptomAnnotationApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, - "create_text_covid_symptom_annotations", - return_value="foo") as create_annotations: - annotated = client._annotate_covid_symptom(self.api, - self.example_request) - assert annotated == "foo" - resource_api.assert_called_once_with(self.api) - create_annotations.assert_called_once_with( - text_covid_symptom_annotation_request=self.example_request - ) - - def test_annotate_note__wrong_tool_type(self): - """Wrong tool type""" - with pytest.raises(ValueError, match="Invalid annotator_type: foo"): - client.annotate_note(host=self.host, note=self.example_note, - tool_type="foo") - - @pytest.mark.parametrize("tool_type,tool_func", [ - ("nlpsandbox:date-annotator", "_annotate_date"), - ("nlpsandbox:person-name-annotator", "_annotate_person_name"), - ("nlpsandbox:physical-address-annotator", - "_annotate_physical_address"), - ("nlpsandbox:id-annotator", "_annotate_id"), - ("nlpsandbox:covid-symptom-annotator", "_annotate_covid_symptom"), - ("nlpsandbox:contact-annotator", "_annotate_contact"), - ]) - def test_annotate_note(self, tool_type, tool_func): - """Test annotate note""" - with self.config as config,\ - self.api_client as api_client,\ - patch.object(client, tool_func, - return_value=self.date_response) as patch_annot: - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - - result = client.annotate_note( - host=self.host, note=self.example_note, tool_type=tool_type - ) - config.assert_called_once_with(host=self.host) - api_client.assert_called_once_with(self.configuration) - patch_annot.assert_called_once_with(self.api, self.example_request) - assert result == { - 'textDateAnnotations': [ - {'start': 10, 'length': 10, 'text': 'foobar', 'confidence': 95.5} - ] - } - - def test_get_tool(self): - """Get tool""" - tool_example = Tool( - name="foo", version="1.0.0", license=License("apache-2.0"), - repository="www.google.com", description="foobar", - author="Bob", author_email="email@email.com", url="www.google.com", - type=ToolType("tool"), api_version="1.0.0" - ) - with self.config as config,\ - self.api_client as api_client,\ - patch.object(tool_api, "ToolApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "get_tool", - return_value=tool_example) as get_tool,\ - patch.object(client, "_get_tool_redirect", - return_value=tool_example.to_dict()): - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - tool = client.get_tool(host=self.host) - assert tool == tool_example - - def test_get_tool__invalid(self): - """Tool and redirect don't match""" - tool_example = Tool( - name="foo", version="1.0.0", license=License("apache-2.0"), - repository="www.google.com", description="foobar", - author="Bob", author_email="email@email.com", url="www.google.com", - type=ToolType("tool"), api_version="1.0.0" - ) - with self.config as config,\ - self.api_client as api_client,\ - patch.object(tool_api, "ToolApi", - return_value=self.mock_api) as resource_api,\ - patch.object(self.mock_api, "get_tool", - return_value=tool_example) as get_tool,\ - patch.object(client, "_get_tool_redirect", - return_value={}),\ - pytest.raises(ValueError, match="Tool base URL must redirect*"): - api_client.return_value = api_client - api_client.__enter__ = Mock(return_value=self.api) - api_client.__exit__ = Mock(return_value=None) - tool = client.get_tool(host=self.host) diff --git a/test/client/test_evaluation.py b/test/client/test_evaluation.py deleted file mode 100644 index 537ca24f..00000000 --- a/test/client/test_evaluation.py +++ /dev/null @@ -1,96 +0,0 @@ -"""Test evaluation code""" -import math -import os - -from nlpsandboxclient import evaluation - -class TestEvaluation: - """Test evaluation""" - - def setup_method(self): - script_dir = os.path.dirname(os.path.realpath(__file__)) - self.pred_filepath = os.path.join(script_dir, - "../data/new_prediction.json") - self.gold_filepath = os.path.join(script_dir, - "../data/new_goldstandard.json") - - def test_date(self): - """Test date evaluation""" - expected_results = { - 'date_location': [ - {'metric': 'F1', 'value': 0.75, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'precision', 'value': 0.75, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'recall', 'value': 0.75, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'F1', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'precision', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'recall', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'F1', 'value': 0.67, 'type': 'token', 'mode': 'strict'}, - {'metric': 'precision', 'value': 0.6, 'type': 'token', 'mode': 'strict'}, - {'metric': 'recall', 'value': 0.75, 'type': 'token', 'mode': 'strict'} - ], - 'date_type': [ - {'metric': 'F1', 'value': None}, - {'metric': 'precision', 'value': None}, - {'metric': 'recall', 'value': None} - ] - } - date_evaluator = evaluation.DateEvaluation() - date_evaluator.convert_dict(self.pred_filepath, self.gold_filepath) - results = date_evaluator.eval() - for date_type in results['date_type']: - if math.isnan(date_type['value']): - date_type['value'] = None - assert results == expected_results - - def test_person(self): - """Test person evaluation""" - expected_results = { - 'person_location': [ - {'metric': 'F1', 'value': 0.5, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'precision', 'value': 0.5, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'recall', 'value': 0.5, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'F1', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'precision', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'recall', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'F1', 'value': 0.77, 'type': 'token', 'mode': 'strict'}, - {'metric': 'precision', 'value': 0.83, 'type': 'token', 'mode': 'strict'}, - {'metric': 'recall', 'value': 0.71, 'type': 'token', 'mode': 'strict'} - ], - 'person_type': [ - {'metric': 'F1', 'value': None}, - {'metric': 'precision', 'value': None}, - {'metric': 'recall', 'value': None} - ] - } - evaluator = evaluation.PersonNameEvaluation() - evaluator.convert_dict(self.pred_filepath, self.gold_filepath) - results = evaluator.eval() - for person_type in results['person_type']: - if math.isnan(person_type['value']): - person_type['value'] = None - assert results == expected_results - - def test_address(self): - """Test person evaluation""" - expected_results = { - 'address_location': [ - {'metric': 'F1', 'value': 0.75, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'precision', 'value': 0.75, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'recall', 'value': 0.75, 'type': 'instance', 'mode': 'relax'}, - {'metric': 'F1', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'precision', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'recall', 'value': 0.5, 'type': 'instance', 'mode': 'strict'}, - {'metric': 'F1', 'value': 0.67, 'type': 'token', 'mode': 'strict'}, - {'metric': 'precision', 'value': 0.75, 'type': 'token', 'mode': 'strict'}, - {'metric': 'recall', 'value': 0.6, 'type': 'token', 'mode': 'strict'} - ], - 'address_type': [ - {'metric': 'F1', 'value': 0.5}, - {'metric': 'precision', 'value': 0.5}, - {'metric': 'recall', 'value': 0.5} - ] - } - evaluator = evaluation.PhysicalAddressEvaluation() - evaluator.convert_dict(self.pred_filepath, self.gold_filepath) - results = evaluator.eval() - assert results == expected_results diff --git a/test/data/README.md b/test/data/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/test/data/goldstandard_1.json b/test/data/goldstandard_1.json deleted file mode 100644 index 5bbd85f0..00000000 --- a/test/data/goldstandard_1.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "date_annotations": [ - { - "noteId": 0, - "start": 20, - "length": 10, - "text": "11/21/2019", - "dateFormat": "MM/DD/YYYY" - }, - { - "noteId": 1, - "start": 45, - "length": 10, - "text": "12/25/2020", - "dateFormat": "MM/DD/YYYY" - }, - { - "noteId": 2, - "start": 45, - "length": 10, - "text": "12/25/2020", - "dateFormat": "MM/DD/YYYY" - }, - { - "noteId": 3, - "start": 47, - "length": 9, - "text": "Wednesday", - "dateFormat": "D" - } - ], - "person_name_annotations": [ - { - "noteId": 0, - "start": 20, - "length": 8, - "text": "Dr.Smith", - "person_type": "doctor" - }, - { - "noteId": 1, - "start": 45, - "length": 9, - "text": "Jon Smith", - "person_type": "patient" - }, - { - "noteId": 3, - "start": 20, - "length": 11, - "text": "DrSmith Ke", - "person_type": "doctor" - }, - { - "noteId": 2, - "start": 25, - "length": 6, - "text": "Jon Ki", - "person_type": "patient" - } - ], - "physical_location_annotations": [ - { - "noteId": 0, - "start": 40, - "length": 7, - "text": "Seattle", - "address_type": "city" - }, - { - "noteId": 1, - "start": 98, - "length": 2, - "text": "WA", - "address_type": "state" - }, - { - "noteId": 3, - "start": 22, - "length": 11, - "text": "UW medicine", - "address_type": "hospitalization" - }, - { - "noteId": 4, - "start": 25, - "length": 7, - "text": "David's", - "address_type": "organization" - } - ] -} diff --git a/test/data/new_goldstandard.json b/test/data/new_goldstandard.json deleted file mode 100644 index b6f469fe..00000000 --- a/test/data/new_goldstandard.json +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - "annotationSource": { - "resourceSource": { - "name": "0" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 20, - "length": 10, - "text": "11/21/2019", - "confidence": 100, - "dateFormat": "MM/DD/YYYY" - } - ], - "textPersonNameAnnotations": [ - { - "start": 20, - "length": 8, - "text": "Dr.Smith", - "confidence": 100, - "personType": "doctor" - } - ], - "textPhysicalAddressAnnotations": [ - { - "start": 40, - "length": 7, - "text": "Seattle", - "confidence": 100, - "addressType": "city" - } - ] - }, { - "annotationSource": { - "resourceSource": { - "name": "1" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 45, - "length": 10, - "text": "12/25/2020", - "confidence": 100, - "dateFormat": "MM/DD/YYYY" - } - ], - "textPersonNameAnnotations": [ - { - "start": 45, - "length": 9, - "text": "Jon Smith", - "confidence": 100, - "personType": "patient" - } - ], - "textPhysicalAddressAnnotations": [ - { - "start": 98, - "length": 2, - "text": "WA", - "confidence": 100, - "addressType": "state" - } - ] - }, { - "annotationSource": { - "resourceSource": { - "name": "2" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 45, - "length": 10, - "text": "12/25/2020", - "confidence": 100, - "dateFormat": "MM/DD/YYYY" - } - ], - "textPersonNameAnnotations": [ - { - "start": 25, - "length": 6, - "text": "Jon Ki", - "confidence": 100, - "personType": "patient" - } - ], - "textPhysicalAddressAnnotations": [] - }, { - "annotationSource": { - "resourceSource": { - "name": "3" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 47, - "length": 9, - "text": "Wednesday", - "confidence": 100, - "dateFormat": "D" - } - ], - "textPersonNameAnnotations": [ - { - "start": 20, - "length": 11, - "text": "DrSmith Ke", - "confidence": 100, - "personType": "doctor" - } - ], - "textPhysicalAddressAnnotations": [ - { - "start": 22, - "length": 11, - "text": "UW medicine", - "confidence": 100, - "addressType": "hospitalization" - } - ] - }, { - "annotationSource": { - "resourceSource": { - "name": "4" - } - }, - "name": "name", - "textDateAnnotations": [], - "textPersonNameAnnotations": [], - "textPhysicalAddressAnnotations": [ - { - "start": 25, - "length": 7, - "text": "David's", - "confidence": 100, - "addressType": "organization" - } - ] - } -] diff --git a/test/data/new_prediction.json b/test/data/new_prediction.json deleted file mode 100644 index cd0013d9..00000000 --- a/test/data/new_prediction.json +++ /dev/null @@ -1,149 +0,0 @@ -[ - { - "annotationSource": { - "resourceSource": { - "name": "0" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 20, - "length": 10, - "text": "11/21/2019", - "confidence": 95.5, - "dateFormat": "MM/DD/YYYY" - } - ], - "textPersonNameAnnotations": [ - { - "start": 20, - "length": 8, - "text": "Dr.Smith", - "confidence": 95.5, - "personType": "doctor" - } - ], - "textPhysicalAddressAnnotations": [ - { - "start": 40, - "length": 7, - "text": "Seattle", - "confidence": 95.5, - "addressType": "city" - } - ] - }, { - "annotationSource": { - "resourceSource": { - "name": "1" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 45, - "length": 10, - "text": "12/25/2020", - "confidence": 95.5, - "dateFormat": "MM/DD/YYYY" - } - ], - "textPersonNameAnnotations": [ - { - "start": 45, - "length": 9, - "text": "Jon Smith", - "confidence": 95.5, - "personType": "patient" - } - ], - "textPhysicalAddressAnnotations": [ - { - "start": 98, - "length": 2, - "text": "WA", - "confidence": 95.5, - "addressType": "state" - } - ] - }, { - "annotationSource": { - "resourceSource": { - "name": "2" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 45, - "length": 8, - "text": "12/25/20", - "confidence": 95.5, - "dateFormat": "MM/DD/YYYY" - } - ], - "textPersonNameAnnotations": [ - { - "start": 25, - "length": 3, - "text": "Jon", - "confidence": 95.5, - "personType": "patient" - } - ], - "textPhysicalAddressAnnotations": [] - }, { - "annotationSource": { - "resourceSource": { - "name": "3" - } - }, - "name": "name", - "textDateAnnotations": [ - { - "start": 42, - "length": 14, - "text": "This Wednesday", - "confidence": 95.5, - "dateFormat": "D" - } - ], - "textPersonNameAnnotations": [ - { - "start": 22, - "length": 8, - "text": "Smith Ke", - "confidence": 95.5, - "personType": "patient" - } - ], - "textPhysicalAddressAnnotations": [ - { - "start": 22, - "length": 2, - "text": "UW", - "confidence": 95.5, - "addressType": "organization" - } - ] - }, { - "annotationSource": { - "resourceSource": { - "name": "4" - } - }, - "name": "name", - "textDateAnnotations": [], - "textPersonNameAnnotations": [], - "textPhysicalAddressAnnotations": [ - { - "start": 25, - "length": 5, - "text": "David", - "confidence": 95.5, - "addressType": "organization" - } - ] - } -] diff --git a/test/data/prediction_1.json b/test/data/prediction_1.json deleted file mode 100644 index 4d76d26d..00000000 --- a/test/data/prediction_1.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "date_annotations": [ - { - "noteId": 0, - "start": 20, - "length": 10, - "text": "11/21/2019", - "dateFormat": "MM/DD/YYYY" - }, - { - "noteId": 1, - "start": 45, - "length": 10, - "text": "12/25/2020", - "dateFormat": "MM/DD/YYYY" - }, - { - "noteId": 2, - "start": 45, - "length": 8, - "text": "12/25/20", - "dateFormat": "MM/DD/YYYY" - }, - { - "noteId": 3, - "start": 42, - "length": 14, - "text": "This Wednesday", - "dateFormat": "D" - } - ], - "person_name_annotations": [ - { - "noteId": 0, - "start": 20, - "length": 8, - "text": "Dr.Smith", - "person_type": "doctor" - }, - { - "noteId": 1, - "start": 45, - "length": 9, - "text": "Jon Smith", - "person_type": "patient" - }, - { - "noteId": 3, - "start": 22, - "length": 8, - "text": "Smith Ke", - "person_type": "patient" - }, - { - "noteId": 2, - "start": 25, - "length": 3, - "text": "Jon", - "person_type": "patient" - } - ], - "physical_location_annotations": [ - { - "noteId": 0, - "start": 40, - "length": 7, - "text": "Seattle", - "address_type": "city" - }, - { - "noteId": 1, - "start": 98, - "length": 2, - "text": "WA", - "address_type": "state" - }, - { - "noteId": 3, - "start": 22, - "length": 2, - "text": "UW", - "address_type": "organization" - }, - { - "noteId": 4, - "start": 25, - "length": 5, - "text": "David", - "address_type": "organization" - } - ] -} diff --git a/test/test_annotation.py b/test/test_annotation.py index a44c17ee..73ea05aa 100644 --- a/test/test_annotation.py +++ b/test/test_annotation.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -19,16 +19,16 @@ from nlpsandbox.model.text_covid_symptom_annotation import TextCovidSymptomAnnotation from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.text_id_annotation import TextIdAnnotation +from nlpsandbox.model.text_location_annotation import TextLocationAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation -from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation globals()['AnnotationName'] = AnnotationName globals()['AnnotationSource'] = AnnotationSource globals()['TextContactAnnotation'] = TextContactAnnotation globals()['TextCovidSymptomAnnotation'] = TextCovidSymptomAnnotation globals()['TextDateAnnotation'] = TextDateAnnotation globals()['TextIdAnnotation'] = TextIdAnnotation +globals()['TextLocationAnnotation'] = TextLocationAnnotation globals()['TextPersonNameAnnotation'] = TextPersonNameAnnotation -globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation from nlpsandbox.model.annotation import Annotation diff --git a/test/test_annotation_api.py b/test/test_annotation_api.py index f7b3d08d..6c31ebf6 100644 --- a/test/test_annotation_api.py +++ b/test/test_annotation_api.py @@ -1,20 +1,18 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.annotation_api import AnnotationApi # noqa: E501 -from nlpsandbox.models import ResourceSource class TestAnnotationApi(unittest.TestCase): @@ -22,60 +20,37 @@ class TestAnnotationApi(unittest.TestCase): def setUp(self): self.api = AnnotationApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_annotation(self): """Test case for create_annotation Create an annotation # noqa: E501 """ - self.api.create_annotation( - dataset_id="awesome-dataset", - annotation_store_id="awesome-annotation-store", - annotation_id="awesome-annotation", - annotation_create_request={ - "annotation_source": { - "resource_source": ResourceSource("source") - }, - "text_date_annotations": [] - } - ) + pass def test_delete_annotation(self): """Test case for delete_annotation Delete an annotation # noqa: E501 """ - self.api.delete_annotation( - dataset_id="data", - annotation_store_id="data", - annotation_id="data" - ) + pass def test_get_annotation(self): """Test case for get_annotation Get an annotation # noqa: E501 """ - self.api.get_annotation( - dataset_id="data", - annotation_store_id="data", - annotation_id="data" - ) + pass def test_list_annotations(self): """Test case for list_annotations List the annotations in an annotation store # noqa: E501 """ - self.api.list_annotations( - dataset_id="data", - annotation_store_id="data" - ) + pass if __name__ == '__main__': diff --git a/test/test_annotation_create_request.py b/test/test_annotation_create_request.py index be70504d..a81761c5 100644 --- a/test/test_annotation_create_request.py +++ b/test/test_annotation_create_request.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -18,15 +18,15 @@ from nlpsandbox.model.text_covid_symptom_annotation import TextCovidSymptomAnnotation from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.text_id_annotation import TextIdAnnotation +from nlpsandbox.model.text_location_annotation import TextLocationAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation -from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation globals()['AnnotationSource'] = AnnotationSource globals()['TextContactAnnotation'] = TextContactAnnotation globals()['TextCovidSymptomAnnotation'] = TextCovidSymptomAnnotation globals()['TextDateAnnotation'] = TextDateAnnotation globals()['TextIdAnnotation'] = TextIdAnnotation +globals()['TextLocationAnnotation'] = TextLocationAnnotation globals()['TextPersonNameAnnotation'] = TextPersonNameAnnotation -globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation from nlpsandbox.model.annotation_create_request import AnnotationCreateRequest diff --git a/test/test_annotation_create_response.py b/test/test_annotation_create_response.py index f189a89f..fce351a3 100644 --- a/test/test_annotation_create_response.py +++ b/test/test_annotation_create_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testAnnotationCreateResponse(self): """Test AnnotationCreateResponse""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationCreateResponse() # noqa: E501 - AnnotationCreateResponse(name=AnnotationName("foo")) + pass if __name__ == '__main__': diff --git a/test/test_annotation_id.py b/test/test_annotation_id.py index ab976bee..7cf6505a 100644 --- a/test/test_annotation_id.py +++ b/test/test_annotation_id.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testAnnotationId(self): """Test AnnotationId""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationId() # noqa: E501 - annot_id = AnnotationId("foo") + pass if __name__ == '__main__': diff --git a/test/test_annotation_name.py b/test/test_annotation_name.py index 49ffe10a..77b826c0 100644 --- a/test/test_annotation_name.py +++ b/test/test_annotation_name.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testAnnotationName(self): """Test AnnotationName""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationName() # noqa: E501 - name = AnnotationName("name") + pass if __name__ == '__main__': diff --git a/test/test_annotation_set.py b/test/test_annotation_set.py index bec9aad1..93845e64 100644 --- a/test/test_annotation_set.py +++ b/test/test_annotation_set.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -16,13 +16,13 @@ from nlpsandbox.model.text_contact_annotation import TextContactAnnotation from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.text_id_annotation import TextIdAnnotation +from nlpsandbox.model.text_location_annotation import TextLocationAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation -from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation globals()['TextContactAnnotation'] = TextContactAnnotation globals()['TextDateAnnotation'] = TextDateAnnotation globals()['TextIdAnnotation'] = TextIdAnnotation +globals()['TextLocationAnnotation'] = TextLocationAnnotation globals()['TextPersonNameAnnotation'] = TextPersonNameAnnotation -globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation from nlpsandbox.model.annotation_set import AnnotationSet diff --git a/test/test_annotation_source.py b/test/test_annotation_source.py index b6cdc709..25b8415b 100644 --- a/test/test_annotation_source.py +++ b/test/test_annotation_source.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testAnnotationSource(self): """Test AnnotationSource""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationSource() # noqa: E501 - store = AnnotationSource(resource_source=ResourceSource("foo")) + pass if __name__ == '__main__': diff --git a/test/test_annotation_store.py b/test/test_annotation_store.py index a28c0151..b4be987c 100644 --- a/test/test_annotation_store.py +++ b/test/test_annotation_store.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testAnnotationStore(self): """Test AnnotationStore""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationStore() # noqa: E501 - model = AnnotationStore(name=AnnotationStoreName("test")) + pass if __name__ == '__main__': diff --git a/test/test_annotation_store_api.py b/test/test_annotation_store_api.py index c142cd42..33f0c87e 100644 --- a/test/test_annotation_store_api.py +++ b/test/test_annotation_store_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch, Mock import nlpsandbox from nlpsandbox.api.annotation_store_api import AnnotationStoreApi # noqa: E501 @@ -21,51 +20,37 @@ class TestAnnotationStoreApi(unittest.TestCase): def setUp(self): self.api = AnnotationStoreApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_annotation_store(self): """Test case for create_annotation_store Create an annotation store # noqa: E501 """ - self.api.create_annotation_store( - dataset_id="dataset", - annotation_store_id="store", - body={} - ) + pass def test_delete_annotation_store(self): """Test case for delete_annotation_store Delete an annotation store # noqa: E501 """ - self.api.delete_annotation_store( - dataset_id="dataset", - annotation_store_id="store" - ) + pass def test_get_annotation_store(self): """Test case for get_annotation_store Get an annotation store # noqa: E501 """ - self.api.get_annotation_store( - dataset_id="dataset", - annotation_store_id="store" - ) + pass def test_list_annotation_stores(self): """Test case for list_annotation_stores List the annotation stores in a dataset # noqa: E501 """ - self.api.list_annotation_stores( - dataset_id="dataset" - ) + pass if __name__ == '__main__': diff --git a/test/test_annotation_store_create_response.py b/test/test_annotation_store_create_response.py index 7a2cd427..243f3faa 100644 --- a/test/test_annotation_store_create_response.py +++ b/test/test_annotation_store_create_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,9 +31,7 @@ def testAnnotationStoreCreateResponse(self): """Test AnnotationStoreCreateResponse""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationStoreCreateResponse() # noqa: E501 - model = AnnotationStoreCreateResponse( - name=AnnotationStoreName("name") - ) + pass if __name__ == '__main__': diff --git a/test/test_annotation_store_id.py b/test/test_annotation_store_id.py index 9ef00201..1741b6a6 100644 --- a/test/test_annotation_store_id.py +++ b/test/test_annotation_store_id.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testAnnotationStoreId(self): """Test AnnotationStoreId""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationStoreId() # noqa: E501 - model = AnnotationStoreId("id34") + pass if __name__ == '__main__': diff --git a/test/test_annotation_store_name.py b/test/test_annotation_store_name.py index c5351600..25a19ed6 100644 --- a/test/test_annotation_store_name.py +++ b/test/test_annotation_store_name.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testAnnotationStoreName(self): """Test AnnotationStoreName""" # FIXME: construct object with mandatory attributes with example values # model = AnnotationStoreName() # noqa: E501 - model = AnnotationStoreName("name") + pass if __name__ == '__main__': diff --git a/test/test_dataset.py b/test/test_dataset.py index a635f26c..33783edb 100644 --- a/test/test_dataset.py +++ b/test/test_dataset.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testDataset(self): """Test Dataset""" # FIXME: construct object with mandatory attributes with example values # model = Dataset() # noqa: E501 - Dataset(name=DatasetName("foo")) + pass if __name__ == '__main__': diff --git a/test/test_dataset_api.py b/test/test_dataset_api.py index 100bf345..55e22eb7 100644 --- a/test/test_dataset_api.py +++ b/test/test_dataset_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.dataset_api import DatasetApi # noqa: E501 @@ -21,46 +20,37 @@ class TestDatasetApi(unittest.TestCase): def setUp(self): self.api = DatasetApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_dataset(self): """Test case for create_dataset Create a dataset # noqa: E501 """ - self.api.create_dataset( - dataset_id="foo", - body={} - ) + pass def test_delete_dataset(self): """Test case for delete_dataset Delete a dataset by ID # noqa: E501 """ - self.api.delete_dataset( - dataset_id="foo" - ) + pass def test_get_dataset(self): """Test case for get_dataset Get a dataset by ID # noqa: E501 """ - self.api.get_dataset( - dataset_id="foo" - ) + pass def test_list_datasets(self): """Test case for list_datasets Get all datasets # noqa: E501 """ - self.api.list_datasets() + pass if __name__ == '__main__': diff --git a/test/test_dataset_create_response.py b/test/test_dataset_create_response.py index ecd4200c..0d0dd196 100644 --- a/test/test_dataset_create_response.py +++ b/test/test_dataset_create_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testDatasetCreateResponse(self): """Test DatasetCreateResponse""" # FIXME: construct object with mandatory attributes with example values # model = DatasetCreateResponse() # noqa: E501 - model = DatasetCreateResponse(name=DatasetName("name")) + pass if __name__ == '__main__': diff --git a/test/test_dataset_id.py b/test/test_dataset_id.py index ac41d62a..13e2e1c2 100644 --- a/test/test_dataset_id.py +++ b/test/test_dataset_id.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testDatasetId(self): """Test DatasetId""" # FIXME: construct object with mandatory attributes with example values # model = DatasetId() # noqa: E501 - DatasetId("datasetid") + pass if __name__ == '__main__': diff --git a/test/test_dataset_name.py b/test/test_dataset_name.py index c74072af..ae51b5da 100644 --- a/test/test_dataset_name.py +++ b/test/test_dataset_name.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testDatasetName(self): """Test DatasetName""" # FIXME: construct object with mandatory attributes with example values # model = DatasetName() # noqa: E501 - DatasetName("name") + pass if __name__ == '__main__': diff --git a/test/test_date_offset_config.py b/test/test_date_offset_config.py index 8ef8bee1..c0a83cab 100644 --- a/test/test_date_offset_config.py +++ b/test/test_date_offset_config.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_deidentification_step.py b/test/test_deidentification_step.py index c63cceb4..7f30e623 100644 --- a/test/test_deidentification_step.py +++ b/test/test_deidentification_step.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_deidentified_note_api.py b/test/test_deidentified_note_api.py index 4387c27c..24d8da70 100644 --- a/test/test_deidentified_note_api.py +++ b/test/test_deidentified_note_api.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_deidentify_request.py b/test/test_deidentify_request.py index e6ba9815..864a1256 100644 --- a/test/test_deidentify_request.py +++ b/test/test_deidentify_request.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_deidentify_response.py b/test/test_deidentify_response.py index 3b5e56b5..415e0f86 100644 --- a/test/test_deidentify_response.py +++ b/test/test_deidentify_response.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_error.py b/test/test_error.py index 11ea4c21..8582f908 100644 --- a/test/test_error.py +++ b/test/test_error.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,7 @@ import nlpsandbox from nlpsandbox.model.error import Error -from nlpsandbox.model import error + class TestError(unittest.TestCase): """Error unit test stubs""" @@ -29,8 +29,8 @@ def testError(self): """Test Error""" # FIXME: construct object with mandatory attributes with example values # model = Error() # noqa: E501 - Error(title="foo", status=200) - error.Error(title="foo", status=200) + pass + if __name__ == '__main__': unittest.main() diff --git a/test/test_fhir_store.py b/test/test_fhir_store.py index d52f13d8..837f0924 100644 --- a/test/test_fhir_store.py +++ b/test/test_fhir_store.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testFhirStore(self): """Test FhirStore""" # FIXME: construct object with mandatory attributes with example values # model = FhirStore() # noqa: E501 - FhirStore(name=FhirStoreName("name")) + pass if __name__ == '__main__': diff --git a/test/test_fhir_store_api.py b/test/test_fhir_store_api.py index 57552005..876ccdf1 100644 --- a/test/test_fhir_store_api.py +++ b/test/test_fhir_store_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.fhir_store_api import FhirStoreApi # noqa: E501 @@ -21,49 +20,37 @@ class TestFhirStoreApi(unittest.TestCase): def setUp(self): self.api = FhirStoreApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_fhir_store(self): """Test case for create_fhir_store Create a FHIR store # noqa: E501 """ - self.api.create_fhir_store( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store", - body={} - ) + pass def test_delete_fhir_store(self): """Test case for delete_fhir_store Delete a FHIR store # noqa: E501 """ - self.api.delete_fhir_store( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store", - ) + pass def test_get_fhir_store(self): """Test case for get_fhir_store Get a FHIR store # noqa: E501 """ - self.api.get_fhir_store( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store", - ) + pass def test_list_fhir_stores(self): """Test case for list_fhir_stores List the FHIR stores in a dataset # noqa: E501 """ - self.api.list_fhir_stores(dataset_id="awesome-dataset") + pass if __name__ == '__main__': diff --git a/test/test_fhir_store_create_response.py b/test/test_fhir_store_create_response.py index 2a905939..bf4b980d 100644 --- a/test/test_fhir_store_create_response.py +++ b/test/test_fhir_store_create_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testFhirStoreCreateResponse(self): """Test FhirStoreCreateResponse""" # FIXME: construct object with mandatory attributes with example values # model = FhirStoreCreateResponse() # noqa: E501 - FhirStoreCreateResponse(name=FhirStoreName("name")) + pass if __name__ == '__main__': diff --git a/test/test_fhir_store_id.py b/test/test_fhir_store_id.py index 68a463f5..943718b1 100644 --- a/test/test_fhir_store_id.py +++ b/test/test_fhir_store_id.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testFhirStoreId(self): """Test FhirStoreId""" # FIXME: construct object with mandatory attributes with example values # model = FhirStoreId() # noqa: E501 - FhirStoreId("myid") + pass if __name__ == '__main__': diff --git a/test/test_fhir_store_name.py b/test/test_fhir_store_name.py index 20e6ee9a..d8a0bf9d 100644 --- a/test/test_fhir_store_name.py +++ b/test/test_fhir_store_name.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testFhirStoreName(self): """Test FhirStoreName""" # FIXME: construct object with mandatory attributes with example values # model = FhirStoreName() # noqa: E501 - FhirStoreName("fhir-store") + pass if __name__ == '__main__': diff --git a/test/test_health_check.py b/test/test_health_check.py index 09582074..cc866f83 100644 --- a/test/test_health_check.py +++ b/test/test_health_check.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.health_check import HealthCheck -from nlpsandbox.model import health_check class TestHealthCheck(unittest.TestCase): @@ -30,8 +29,7 @@ def testHealthCheck(self): """Test HealthCheck""" # FIXME: construct object with mandatory attributes with example values # model = HealthCheck() # noqa: E501 - HealthCheck(status="pass") - health_check.HealthCheck(status="pass") + pass if __name__ == '__main__': diff --git a/test/test_health_check_api.py b/test/test_health_check_api.py index 56f7ea1b..85f32213 100644 --- a/test/test_health_check_api.py +++ b/test/test_health_check_api.py @@ -1,20 +1,18 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.health_check_api import HealthCheckApi # noqa: E501 -from nlpsandbox.api import health_check_api class TestHealthCheckApi(unittest.TestCase): @@ -22,28 +20,17 @@ class TestHealthCheckApi(unittest.TestCase): def setUp(self): self.api = HealthCheckApi() # noqa: E501 - self.nlpsandbox_api = health_check_api.HealthCheckApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() - self.patcher_f = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_annot = self.patcher_f.start() def tearDown(self): - self.patcher.stop() + pass def test_get_health_check(self): """Test case for get_health_check Get health check information # noqa: E501 """ - self.api.get_health_check() + pass - def test_get_nlpsandbox_health_check(self): - """Test case for get_health_check - - Get health check information # noqa: E501 - """ - self.nlpsandbox_api.get_health_check() if __name__ == '__main__': unittest.main() diff --git a/test/test_license.py b/test/test_license.py index 08539413..e7965548 100644 --- a/test/test_license.py +++ b/test/test_license.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testLicense(self): """Test License""" # FIXME: construct object with mandatory attributes with example values # model = License() # noqa: E501 - License("apache-2.0") + pass if __name__ == '__main__': diff --git a/test/test_masking_char_config.py b/test/test_masking_char_config.py index 1b81a1d9..02e857b0 100644 --- a/test/test_masking_char_config.py +++ b/test/test_masking_char_config.py @@ -3,7 +3,7 @@ NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_note.py b/test/test_note.py index 2d8cefa5..0d20f367 100644 --- a/test/test_note.py +++ b/test/test_note.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -33,11 +33,7 @@ def testNote(self): """Test Note""" # FIXME: construct object with mandatory attributes with example values # model = Note() # noqa: E501 - Note( - identifier=NoteId("identifier"), - text="text", type="type", - patient_id=PatientId('patient-1') - ) + pass if __name__ == '__main__': diff --git a/test/test_note_api.py b/test/test_note_api.py index d3eb2c1f..4379e7d1 100644 --- a/test/test_note_api.py +++ b/test/test_note_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.note_api import NoteApi # noqa: E501 @@ -21,59 +20,37 @@ class TestNoteApi(unittest.TestCase): def setUp(self): self.api = NoteApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_note(self): """Test case for create_note Create a note # noqa: E501 """ - self.api.create_note( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store", - note_id="awesome-note", - note_create_request={ - "text": "texting foo", - "type": "loinc:LP29684-5", - "patient_id": "awesome-patient" - } - ) + pass def test_delete_note(self): """Test case for delete_note Delete a note # noqa: E501 """ - self.api.delete_note( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store", - note_id="awesome-note" - ) + pass def test_get_note(self): """Test case for get_note Get a note # noqa: E501 """ - self.api.get_note( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store", - note_id="awesome-note" - ) + pass def test_list_notes(self): """Test case for list_notes List notes # noqa: E501 """ - self.api.list_notes( - dataset_id="awesome-dataset", - fhir_store_id="awesome-fhir-store" - ) + pass if __name__ == '__main__': diff --git a/test/test_note_create_request.py b/test/test_note_create_request.py index f9752367..8b4006b6 100644 --- a/test/test_note_create_request.py +++ b/test/test_note_create_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,11 +31,7 @@ def testNoteCreateRequest(self): """Test NoteCreateRequest""" # FIXME: construct object with mandatory attributes with example values # model = NoteCreateRequest() # noqa: E501 - NoteCreateRequest( - text="amazing text", - type="type note", - patient_id=PatientId("patient_id") - ) + pass if __name__ == '__main__': diff --git a/test/test_note_create_response.py b/test/test_note_create_response.py index 708b6e46..4c3c0f5b 100644 --- a/test/test_note_create_response.py +++ b/test/test_note_create_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,7 +31,7 @@ def testNoteCreateResponse(self): """Test NoteCreateResponse""" # FIXME: construct object with mandatory attributes with example values # model = NoteCreateResponse() # noqa: E501 - NoteCreateResponse(name=NoteResourceName("name")) + pass if __name__ == '__main__': diff --git a/test/test_note_id.py b/test/test_note_id.py index bc336ee0..57e760df 100644 --- a/test/test_note_id.py +++ b/test/test_note_id.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testNoteId(self): """Test NoteId""" # FIXME: construct object with mandatory attributes with example values # model = NoteId() # noqa: E501 - NoteId("foo") + pass if __name__ == '__main__': diff --git a/test/test_note_resource_name.py b/test/test_note_resource_name.py index 75130747..33638441 100644 --- a/test/test_note_resource_name.py +++ b/test/test_note_resource_name.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testNoteResourceName(self): """Test NoteResourceName""" # FIXME: construct object with mandatory attributes with example values # model = NoteResourceName() # noqa: E501 - NoteResourceName("notename") + pass if __name__ == '__main__': diff --git a/test/test_page_limit.py b/test/test_page_limit.py index b5f0fe53..04ff50d9 100644 --- a/test/test_page_limit.py +++ b/test/test_page_limit.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testPageLimit(self): """Test PageLimit""" # FIXME: construct object with mandatory attributes with example values # model = PageLimit() # noqa: E501 - PageLimit(10) + pass if __name__ == '__main__': diff --git a/test/test_page_of_annotation_stores.py b/test/test_page_of_annotation_stores.py index 9b08bc3b..58cec3ea 100644 --- a/test/test_page_of_annotation_stores.py +++ b/test/test_page_of_annotation_stores.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -19,7 +19,6 @@ from nlpsandbox.model.page_offset import PageOffset from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks -from nlpsandbox.models import AnnotationStoreName globals()['AnnotationStore'] = AnnotationStore globals()['PageLimit'] = PageLimit globals()['PageOfAnnotationStoresAllOf'] = PageOfAnnotationStoresAllOf @@ -42,13 +41,7 @@ def testPageOfAnnotationStores(self): """Test PageOfAnnotationStores""" # FIXME: construct object with mandatory attributes with example values # model = PageOfAnnotationStores() # noqa: E501 - PageOfAnnotationStores( - offset=PageOffset(3), - limit=PageLimit(10), - total_results=4, - links=ResponsePageMetadataLinks(next="next"), - annotation_stores=[AnnotationStore(name=AnnotationStoreName("name"))] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_annotation_stores_all_of.py b/test/test_page_of_annotation_stores_all_of.py index cc8b8b16..88759d61 100644 --- a/test/test_page_of_annotation_stores_all_of.py +++ b/test/test_page_of_annotation_stores_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.annotation_store import AnnotationStore -from nlpsandbox.models import AnnotationStoreName globals()['AnnotationStore'] = AnnotationStore from nlpsandbox.model.page_of_annotation_stores_all_of import PageOfAnnotationStoresAllOf @@ -32,9 +31,7 @@ def testPageOfAnnotationStoresAllOf(self): """Test PageOfAnnotationStoresAllOf""" # FIXME: construct object with mandatory attributes with example values # model = PageOfAnnotationStoresAllOf() # noqa: E501 - PageOfAnnotationStoresAllOf( - annotation_stores=[AnnotationStore(name=AnnotationStoreName("name"))] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_annotations.py b/test/test_page_of_annotations.py index 31fd3192..1bf79c6b 100644 --- a/test/test_page_of_annotations.py +++ b/test/test_page_of_annotations.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,16 +14,14 @@ import nlpsandbox from nlpsandbox.model.annotation import Annotation -from nlpsandbox.model.annotation_name import AnnotationName -from nlpsandbox.model.annotation_source import AnnotationSource -from nlpsandbox.model.resource_source import ResourceSource -from nlpsandbox.model.text_date_annotation import TextDateAnnotation from nlpsandbox.model.page_limit import PageLimit +from nlpsandbox.model.page_of_annotations_all_of import PageOfAnnotationsAllOf from nlpsandbox.model.page_offset import PageOffset from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks globals()['Annotation'] = Annotation globals()['PageLimit'] = PageLimit +globals()['PageOfAnnotationsAllOf'] = PageOfAnnotationsAllOf globals()['PageOffset'] = PageOffset globals()['ResponsePageMetadata'] = ResponsePageMetadata globals()['ResponsePageMetadataLinks'] = ResponsePageMetadataLinks @@ -43,21 +41,7 @@ def testPageOfAnnotations(self): """Test PageOfAnnotations""" # FIXME: construct object with mandatory attributes with example values # model = PageOfAnnotations() # noqa: E501 - model = Annotation( - name=AnnotationName("name"), - annotation_source=AnnotationSource(resource_source=ResourceSource(name="foo")), - text_date_annotations=[ - TextDateAnnotation(start=1, length=32, text='foo', confidence=95.5) - ] - ) - PageOfAnnotations( - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next="next"), - total_results=30, - annotations=[model] - ) - + pass if __name__ == '__main__': diff --git a/test/test_page_of_annotations_all_of.py b/test/test_page_of_annotations_all_of.py index 6ee60054..d019494b 100644 --- a/test/test_page_of_annotations_all_of.py +++ b/test/test_page_of_annotations_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,10 +14,6 @@ import nlpsandbox from nlpsandbox.model.annotation import Annotation -from nlpsandbox.model.annotation_name import AnnotationName -from nlpsandbox.model.annotation_source import AnnotationSource -from nlpsandbox.model.resource_source import ResourceSource -from nlpsandbox.model.text_date_annotation import TextDateAnnotation globals()['Annotation'] = Annotation from nlpsandbox.model.page_of_annotations_all_of import PageOfAnnotationsAllOf @@ -35,16 +31,7 @@ def testPageOfAnnotationsAllOf(self): """Test PageOfAnnotationsAllOf""" # FIXME: construct object with mandatory attributes with example values # model = PageOfAnnotationsAllOf() # noqa: E501 - model = Annotation( - name=AnnotationName("name"), - annotation_source=AnnotationSource(resource_source=ResourceSource(name="foo")), - text_date_annotations=[ - TextDateAnnotation(start=1, length=32, text='foo', confidence=95.5) - ] - ) - PageOfAnnotationsAllOf( - annotations=[model] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_datasets.py b/test/test_page_of_datasets.py index 8577cdc3..a94181f1 100644 --- a/test/test_page_of_datasets.py +++ b/test/test_page_of_datasets.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -15,12 +15,13 @@ import nlpsandbox from nlpsandbox.model.dataset import Dataset from nlpsandbox.model.page_limit import PageLimit +from nlpsandbox.model.page_of_datasets_all_of import PageOfDatasetsAllOf from nlpsandbox.model.page_offset import PageOffset from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks -from nlpsandbox.models import DatasetName globals()['Dataset'] = Dataset globals()['PageLimit'] = PageLimit +globals()['PageOfDatasetsAllOf'] = PageOfDatasetsAllOf globals()['PageOffset'] = PageOffset globals()['ResponsePageMetadata'] = ResponsePageMetadata globals()['ResponsePageMetadataLinks'] = ResponsePageMetadataLinks @@ -38,13 +39,9 @@ def tearDown(self): def testPageOfDatasets(self): """Test PageOfDatasets""" - PageOfDatasets( - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next="next"), - total_results=30, - datasets=[Dataset(name=DatasetName("foo"))] - ) + # FIXME: construct object with mandatory attributes with example values + # model = PageOfDatasets() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_page_of_datasets_all_of.py b/test/test_page_of_datasets_all_of.py index fae97ab0..3145fb19 100644 --- a/test/test_page_of_datasets_all_of.py +++ b/test/test_page_of_datasets_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.dataset import Dataset -from nlpsandbox.models import DatasetName globals()['Dataset'] = Dataset from nlpsandbox.model.page_of_datasets_all_of import PageOfDatasetsAllOf @@ -32,9 +31,7 @@ def testPageOfDatasetsAllOf(self): """Test PageOfDatasetsAllOf""" # FIXME: construct object with mandatory attributes with example values # model = PageOfDatasetsAllOf() # noqa: E501 - PageOfDatasetsAllOf( - datasets=[Dataset(name=DatasetName("foo"))] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_fhir_stores.py b/test/test_page_of_fhir_stores.py index 7c81f3c9..63559fd7 100644 --- a/test/test_page_of_fhir_stores.py +++ b/test/test_page_of_fhir_stores.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -15,12 +15,13 @@ import nlpsandbox from nlpsandbox.model.fhir_store import FhirStore from nlpsandbox.model.page_limit import PageLimit +from nlpsandbox.model.page_of_fhir_stores_all_of import PageOfFhirStoresAllOf from nlpsandbox.model.page_offset import PageOffset from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks -from nlpsandbox.models import FhirStoreName globals()['FhirStore'] = FhirStore globals()['PageLimit'] = PageLimit +globals()['PageOfFhirStoresAllOf'] = PageOfFhirStoresAllOf globals()['PageOffset'] = PageOffset globals()['ResponsePageMetadata'] = ResponsePageMetadata globals()['ResponsePageMetadataLinks'] = ResponsePageMetadataLinks @@ -38,13 +39,9 @@ def tearDown(self): def testPageOfFhirStores(self): """Test PageOfFhirStores""" - PageOfFhirStores( - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next="next"), - total_results=30, - fhir_stores=[FhirStore(name=FhirStoreName("foo"))] - ) + # FIXME: construct object with mandatory attributes with example values + # model = PageOfFhirStores() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_page_of_fhir_stores_all_of.py b/test/test_page_of_fhir_stores_all_of.py index e3680644..b6378b8a 100644 --- a/test/test_page_of_fhir_stores_all_of.py +++ b/test/test_page_of_fhir_stores_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.fhir_store import FhirStore -from nlpsandbox.models import FhirStoreName globals()['FhirStore'] = FhirStore from nlpsandbox.model.page_of_fhir_stores_all_of import PageOfFhirStoresAllOf @@ -32,9 +31,7 @@ def testPageOfFhirStoresAllOf(self): """Test PageOfFhirStoresAllOf""" # FIXME: construct object with mandatory attributes with example values # model = PageOfFhirStoresAllOf() # noqa: E501 - PageOfFhirStoresAllOf( - fhir_stores=[FhirStore(name=FhirStoreName("foo"))] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_notes.py b/test/test_page_of_notes.py index 05cb0100..3308fc2f 100644 --- a/test/test_page_of_notes.py +++ b/test/test_page_of_notes.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,14 +14,14 @@ import nlpsandbox from nlpsandbox.model.note import Note -from nlpsandbox.model.note_id import NoteId -from nlpsandbox.model.patient_id import PatientId from nlpsandbox.model.page_limit import PageLimit +from nlpsandbox.model.page_of_notes_all_of import PageOfNotesAllOf from nlpsandbox.model.page_offset import PageOffset from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks globals()['Note'] = Note globals()['PageLimit'] = PageLimit +globals()['PageOfNotesAllOf'] = PageOfNotesAllOf globals()['PageOffset'] = PageOffset globals()['ResponsePageMetadata'] = ResponsePageMetadata globals()['ResponsePageMetadataLinks'] = ResponsePageMetadataLinks @@ -41,15 +41,7 @@ def testPageOfNotes(self): """Test PageOfNotes""" # FIXME: construct object with mandatory attributes with example values # model = PageOfNotes() # noqa: E501 - PageOfNotes( - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next="next"), - total_results=30, - notes=[Note(identifier=NoteId("identifier"), - text="text", type="type", - patient_id=PatientId('patient-1'))] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_notes_all_of.py b/test/test_page_of_notes_all_of.py index 6dff5d21..68efd807 100644 --- a/test/test_page_of_notes_all_of.py +++ b/test/test_page_of_notes_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,8 +14,6 @@ import nlpsandbox from nlpsandbox.model.note import Note -from nlpsandbox.model.note_id import NoteId -from nlpsandbox.model.patient_id import PatientId globals()['Note'] = Note from nlpsandbox.model.page_of_notes_all_of import PageOfNotesAllOf @@ -33,11 +31,7 @@ def testPageOfNotesAllOf(self): """Test PageOfNotesAllOf""" # FIXME: construct object with mandatory attributes with example values # model = PageOfNotesAllOf() # noqa: E501 - PageOfNotesAllOf( - notes=[Note(identifier=NoteId("identifier"), - text="text", type="type", - patient_id=PatientId('patient-1'))] - ) + pass if __name__ == '__main__': diff --git a/test/test_page_of_patients.py b/test/test_page_of_patients.py index 85b1a345..d2a71204 100644 --- a/test/test_page_of_patients.py +++ b/test/test_page_of_patients.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,12 +14,13 @@ import nlpsandbox from nlpsandbox.model.page_limit import PageLimit +from nlpsandbox.model.page_of_patients_all_of import PageOfPatientsAllOf from nlpsandbox.model.page_offset import PageOffset from nlpsandbox.model.patient import Patient from nlpsandbox.model.response_page_metadata import ResponsePageMetadata from nlpsandbox.model.response_page_metadata_links import ResponsePageMetadataLinks -from nlpsandbox.models import PatientId globals()['PageLimit'] = PageLimit +globals()['PageOfPatientsAllOf'] = PageOfPatientsAllOf globals()['PageOffset'] = PageOffset globals()['Patient'] = Patient globals()['ResponsePageMetadata'] = ResponsePageMetadata @@ -38,13 +39,9 @@ def tearDown(self): def testPageOfPatients(self): """Test PageOfPatients""" - PageOfPatients( - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next="next"), - total_results=30, - patients=[Patient(identifier=PatientId("note-id"))] - ) + # FIXME: construct object with mandatory attributes with example values + # model = PageOfPatients() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_page_of_patients_all_of.py b/test/test_page_of_patients_all_of.py index f96fe17c..3a85bde7 100644 --- a/test/test_page_of_patients_all_of.py +++ b/test/test_page_of_patients_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.patient import Patient -from nlpsandbox.models import PatientId globals()['Patient'] = Patient from nlpsandbox.model.page_of_patients_all_of import PageOfPatientsAllOf @@ -30,9 +29,9 @@ def tearDown(self): def testPageOfPatientsAllOf(self): """Test PageOfPatientsAllOf""" - PageOfPatientsAllOf( - patients=[Patient(identifier=PatientId("note-id"))] - ) + # FIXME: construct object with mandatory attributes with example values + # model = PageOfPatientsAllOf() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_page_offset.py b/test/test_page_offset.py index e13ed9f8..9be14fa6 100644 --- a/test/test_page_offset.py +++ b/test/test_page_offset.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testPageOffset(self): """Test PageOffset""" # FIXME: construct object with mandatory attributes with example values # model = PageOffset() # noqa: E501 - PageOffset(10) + pass if __name__ == '__main__': diff --git a/test/test_patient.py b/test/test_patient.py index a12f8d4d..e5c7dc3d 100644 --- a/test/test_patient.py +++ b/test/test_patient.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,10 +31,7 @@ def testPatient(self): """Test Patient""" # FIXME: construct object with mandatory attributes with example values # model = Patient() # noqa: E501 - Patient( - identifier=PatientId("patient-id"), - gender="male" - ) + pass if __name__ == '__main__': diff --git a/test/test_patient_api.py b/test/test_patient_api.py index 5fa7b42c..35e1e396 100644 --- a/test/test_patient_api.py +++ b/test/test_patient_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.patient_api import PatientApi # noqa: E501 @@ -21,55 +20,37 @@ class TestPatientApi(unittest.TestCase): def setUp(self): self.api = PatientApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_patient(self): """Test case for create_patient Create a FHIR patient # noqa: E501 """ - self.api.create_patient( - dataset_id="awesome-dataset-id", - fhir_store_id="awesome-fhir-store", - patient_id="awesome-patient", - patient_create_request={"gender": "female"} - ) + pass def test_delete_patient(self): """Test case for delete_patient Delete a FHIR patient # noqa: E501 """ - self.api.delete_patient( - dataset_id="awesome-dataset-id", - fhir_store_id="awesome-fhir-store", - patient_id="awesome-patient" - ) + pass def test_get_patient(self): """Test case for get_patient Get a FHIR patient # noqa: E501 """ - self.api.get_patient( - dataset_id="awesome-dataset-id", - fhir_store_id="awesome-fhir-store", - patient_id="awesome-patient" - ) + pass def test_list_patients(self): """Test case for list_patients List the Patients in a FHIR store # noqa: E501 """ - self.api.list_patients( - dataset_id="awesome-dataset-id", - fhir_store_id="awesome-fhir-store" - ) + pass if __name__ == '__main__': diff --git a/test/test_patient_create_request.py b/test/test_patient_create_request.py index cc4a3e22..1d1d0e3e 100644 --- a/test/test_patient_create_request.py +++ b/test/test_patient_create_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testPatientCreateRequest(self): """Test PatientCreateRequest""" # FIXME: construct object with mandatory attributes with example values # model = PatientCreateRequest() # noqa: E501 - PatientCreateRequest(gender="female") + pass if __name__ == '__main__': diff --git a/test/test_patient_create_response.py b/test/test_patient_create_response.py index 91f32c8b..3cd409dd 100644 --- a/test/test_patient_create_response.py +++ b/test/test_patient_create_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,9 @@ def tearDown(self): def testPatientCreateResponse(self): """Test PatientCreateResponse""" - PatientCreateResponse(name=PatientResourceName("name")) + # FIXME: construct object with mandatory attributes with example values + # model = PatientCreateResponse() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_patient_id.py b/test/test_patient_id.py index b2eda6db..74c95097 100644 --- a/test/test_patient_id.py +++ b/test/test_patient_id.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -27,7 +27,9 @@ def tearDown(self): def testPatientId(self): """Test PatientId""" - PatientId("patient-1") + # FIXME: construct object with mandatory attributes with example values + # model = PatientId() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_patient_resource_name.py b/test/test_patient_resource_name.py index 495e7d50..43b79fcd 100644 --- a/test/test_patient_resource_name.py +++ b/test/test_patient_resource_name.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testPatientResourceName(self): """Test PatientResourceName""" # FIXME: construct object with mandatory attributes with example values # model = PatientResourceName() # noqa: E501 - PatientResourceName("name") + pass if __name__ == '__main__': diff --git a/test/test_programming_language.py b/test/test_programming_language.py new file mode 100644 index 00000000..40628d93 --- /dev/null +++ b/test/test_programming_language.py @@ -0,0 +1,36 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import nlpsandbox +from nlpsandbox.model.programming_language import ProgrammingLanguage + + +class TestProgrammingLanguage(unittest.TestCase): + """ProgrammingLanguage unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testProgrammingLanguage(self): + """Test ProgrammingLanguage""" + # FIXME: construct object with mandatory attributes with example values + # model = ProgrammingLanguage() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_resource_source.py b/test/test_resource_source.py index 7dae5091..aa83e7eb 100644 --- a/test/test_resource_source.py +++ b/test/test_resource_source.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testResourceSource(self): """Test ResourceSource""" # FIXME: construct object with mandatory attributes with example values # model = ResourceSource() # noqa: E501 - ResourceSource("source") + pass if __name__ == '__main__': diff --git a/test/test_response_page_metadata.py b/test/test_response_page_metadata.py index 8e8fde7b..72824673 100644 --- a/test/test_response_page_metadata.py +++ b/test/test_response_page_metadata.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -33,12 +33,9 @@ def tearDown(self): def testResponsePageMetadata(self): """Test ResponsePageMetadata""" - ResponsePageMetadata( - offset=PageOffset(10), - limit=PageLimit(10), - links=ResponsePageMetadataLinks(next="next"), - total_results=30 - ) + # FIXME: construct object with mandatory attributes with example values + # model = ResponsePageMetadata() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_response_page_metadata_links.py b/test/test_response_page_metadata_links.py index 61e2ba39..c1010ace 100644 --- a/test/test_response_page_metadata_links.py +++ b/test/test_response_page_metadata_links.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,7 +29,7 @@ def testResponsePageMetadataLinks(self): """Test ResponsePageMetadataLinks""" # FIXME: construct object with mandatory attributes with example values # model = ResponsePageMetadataLinks() # noqa: E501 - ResponsePageMetadataLinks(next="foo") + pass if __name__ == '__main__': diff --git a/test/test_text_annotation.py b/test/test_text_annotation.py index 21c49c9f..6140e792 100644 --- a/test/test_text_annotation.py +++ b/test/test_text_annotation.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -27,7 +27,9 @@ def tearDown(self): def testTextAnnotation(self): """Test TextAnnotation""" - TextAnnotation(start=10, length=20, text="text now", confidence=95.5) + # FIXME: construct object with mandatory attributes with example values + # model = TextAnnotation() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_contact_annotation.py b/test/test_text_contact_annotation.py index 21dab26e..f9f75fc9 100644 --- a/test/test_text_contact_annotation.py +++ b/test/test_text_contact_annotation.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_contact_annotation_all_of.py b/test/test_text_contact_annotation_all_of.py index 41ad4509..c99f1c38 100644 --- a/test/test_text_contact_annotation_all_of.py +++ b/test/test_text_contact_annotation_all_of.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_contact_annotation_api.py b/test/test_text_contact_annotation_api.py index bcbdd601..c7f33991 100644 --- a/test/test_text_contact_annotation_api.py +++ b/test/test_text_contact_annotation_api.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_contact_annotation_request.py b/test/test_text_contact_annotation_request.py index d0d65d15..65a53d01 100644 --- a/test/test_text_contact_annotation_request.py +++ b/test/test_text_contact_annotation_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_contact_annotation_response.py b/test/test_text_contact_annotation_response.py index e51ccaa1..19ab8079 100644 --- a/test/test_text_contact_annotation_response.py +++ b/test/test_text_contact_annotation_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_covid_symptom_annotation.py b/test/test_text_covid_symptom_annotation.py index 20f2d828..bdd3e59a 100644 --- a/test/test_text_covid_symptom_annotation.py +++ b/test/test_text_covid_symptom_annotation.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_covid_symptom_annotation_all_of.py b/test/test_text_covid_symptom_annotation_all_of.py index c9ae5b81..49f16119 100644 --- a/test/test_text_covid_symptom_annotation_all_of.py +++ b/test/test_text_covid_symptom_annotation_all_of.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_covid_symptom_annotation_api.py b/test/test_text_covid_symptom_annotation_api.py index dca684a5..3c35c784 100644 --- a/test/test_text_covid_symptom_annotation_api.py +++ b/test/test_text_covid_symptom_annotation_api.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_covid_symptom_annotation_request.py b/test/test_text_covid_symptom_annotation_request.py index deafd4e1..096d334f 100644 --- a/test/test_text_covid_symptom_annotation_request.py +++ b/test/test_text_covid_symptom_annotation_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_covid_symptom_annotation_response.py b/test/test_text_covid_symptom_annotation_response.py index f706cc97..e44d868e 100644 --- a/test/test_text_covid_symptom_annotation_response.py +++ b/test/test_text_covid_symptom_annotation_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_date_annotation.py b/test/test_text_date_annotation.py index 850aec71..8a1dd5ae 100644 --- a/test/test_text_date_annotation.py +++ b/test/test_text_date_annotation.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -31,9 +31,9 @@ def tearDown(self): def testTextDateAnnotation(self): """Test TextDateAnnotation""" - TextDateAnnotation( - start=10, length=10, text="foobar", confidence=95.5 - ) + # FIXME: construct object with mandatory attributes with example values + # model = TextDateAnnotation() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_date_annotation_all_of.py b/test/test_text_date_annotation_all_of.py index d205da53..4819300f 100644 --- a/test/test_text_date_annotation_all_of.py +++ b/test/test_text_date_annotation_all_of.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.text_date_annotation_all_of import TextDateAnnotationAllOf -from nlpsandbox.models import TextDateAnnotation class TestTextDateAnnotationAllOf(unittest.TestCase): @@ -28,7 +27,9 @@ def tearDown(self): def testTextDateAnnotationAllOf(self): """Test TextDateAnnotationAllOf""" - TextDateAnnotationAllOf(date_format="foo") + # FIXME: construct object with mandatory attributes with example values + # model = TextDateAnnotationAllOf() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_date_annotation_api.py b/test/test_text_date_annotation_api.py index 95a468f2..6f08f1ce 100644 --- a/test/test_text_date_annotation_api.py +++ b/test/test_text_date_annotation_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.text_date_annotation_api import TextDateAnnotationApi # noqa: E501 @@ -21,27 +20,16 @@ class TestTextDateAnnotationApi(unittest.TestCase): def setUp(self): self.api = TextDateAnnotationApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_text_date_annotations(self): """Test case for create_text_date_annotations Annotate dates in a clinical note # noqa: E501 """ - self.api.create_text_date_annotations( - text_date_annotation_request={ - "note": { - "identifier": "note-1", - "type": "note-type", - "text": "my text here", - "patient_id": "patient-1" - } - } - ) + pass if __name__ == '__main__': diff --git a/test/test_text_date_annotation_request.py b/test/test_text_date_annotation_request.py index 33d2044a..28ced7cd 100644 --- a/test/test_text_date_annotation_request.py +++ b/test/test_text_date_annotation_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.note import Note -from nlpsandbox.models import PatientId, NoteId globals()['Note'] = Note from nlpsandbox.model.text_date_annotation_request import TextDateAnnotationRequest @@ -30,13 +29,9 @@ def tearDown(self): def testTextDateAnnotationRequest(self): """Test TextDateAnnotationRequest""" - TextDateAnnotationRequest( - note=Note( - identifier=NoteId("identifier"), - text="text", type="type", - patient_id=PatientId('patient-1') - ) - ) + # FIXME: construct object with mandatory attributes with example values + # model = TextDateAnnotationRequest() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_date_annotation_response.py b/test/test_text_date_annotation_response.py index f233c567..9f0e17e2 100644 --- a/test/test_text_date_annotation_response.py +++ b/test/test_text_date_annotation_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,11 +29,9 @@ def tearDown(self): def testTextDateAnnotationResponse(self): """Test TextDateAnnotationResponse""" - TextDateAnnotationResponse( - text_date_annotations=[ - TextDateAnnotation(start=10, length=10, text="foobar", confidence=95.5) - ] - ) + # FIXME: construct object with mandatory attributes with example values + # model = TextDateAnnotationResponse() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_id_annotation.py b/test/test_text_id_annotation.py index 3acbf835..4a809ce8 100644 --- a/test/test_text_id_annotation.py +++ b/test/test_text_id_annotation.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_id_annotation_all_of.py b/test/test_text_id_annotation_all_of.py index df5df5a2..37cf1e7e 100644 --- a/test/test_text_id_annotation_all_of.py +++ b/test/test_text_id_annotation_all_of.py @@ -1,9 +1,9 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 + The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_id_annotation_api.py b/test/test_text_id_annotation_api.py index 9cc8aa32..110ef642 100644 --- a/test/test_text_id_annotation_api.py +++ b/test/test_text_id_annotation_api.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_id_annotation_request.py b/test/test_text_id_annotation_request.py index f308e139..1d027aeb 100644 --- a/test/test_text_id_annotation_request.py +++ b/test/test_text_id_annotation_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_id_annotation_response.py b/test/test_text_id_annotation_response.py index 335f9913..d0b74dae 100644 --- a/test/test_text_id_annotation_response.py +++ b/test/test_text_id_annotation_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_text_location_annotation.py b/test/test_text_location_annotation.py new file mode 100644 index 00000000..efbdc3ae --- /dev/null +++ b/test/test_text_location_annotation.py @@ -0,0 +1,40 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import nlpsandbox +from nlpsandbox.model.text_annotation import TextAnnotation +from nlpsandbox.model.text_location_annotation_all_of import TextLocationAnnotationAllOf +globals()['TextAnnotation'] = TextAnnotation +globals()['TextLocationAnnotationAllOf'] = TextLocationAnnotationAllOf +from nlpsandbox.model.text_location_annotation import TextLocationAnnotation + + +class TestTextLocationAnnotation(unittest.TestCase): + """TextLocationAnnotation unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTextLocationAnnotation(self): + """Test TextLocationAnnotation""" + # FIXME: construct object with mandatory attributes with example values + # model = TextLocationAnnotation() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_text_location_annotation_all_of.py b/test/test_text_location_annotation_all_of.py new file mode 100644 index 00000000..2fb35642 --- /dev/null +++ b/test/test_text_location_annotation_all_of.py @@ -0,0 +1,36 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import nlpsandbox +from nlpsandbox.model.text_location_annotation_all_of import TextLocationAnnotationAllOf + + +class TestTextLocationAnnotationAllOf(unittest.TestCase): + """TextLocationAnnotationAllOf unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTextLocationAnnotationAllOf(self): + """Test TextLocationAnnotationAllOf""" + # FIXME: construct object with mandatory attributes with example values + # model = TextLocationAnnotationAllOf() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_text_location_annotation_api.py b/test/test_text_location_annotation_api.py new file mode 100644 index 00000000..69eb5f0f --- /dev/null +++ b/test/test_text_location_annotation_api.py @@ -0,0 +1,36 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import unittest + +import nlpsandbox +from nlpsandbox.api.text_location_annotation_api import TextLocationAnnotationApi # noqa: E501 + + +class TestTextLocationAnnotationApi(unittest.TestCase): + """TextLocationAnnotationApi unit test stubs""" + + def setUp(self): + self.api = TextLocationAnnotationApi() # noqa: E501 + + def tearDown(self): + pass + + def test_create_text_location_annotations(self): + """Test case for create_text_location_annotations + + Annotate locations in a clinical note # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_text_location_annotation_request.py b/test/test_text_location_annotation_request.py new file mode 100644 index 00000000..040b6723 --- /dev/null +++ b/test/test_text_location_annotation_request.py @@ -0,0 +1,38 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import nlpsandbox +from nlpsandbox.model.note import Note +globals()['Note'] = Note +from nlpsandbox.model.text_location_annotation_request import TextLocationAnnotationRequest + + +class TestTextLocationAnnotationRequest(unittest.TestCase): + """TextLocationAnnotationRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTextLocationAnnotationRequest(self): + """Test TextLocationAnnotationRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = TextLocationAnnotationRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_text_location_annotation_response.py b/test/test_text_location_annotation_response.py new file mode 100644 index 00000000..7e907c4c --- /dev/null +++ b/test/test_text_location_annotation_response.py @@ -0,0 +1,38 @@ +""" + NLP Sandbox API + + NLP Sandbox REST API # noqa: E501 + + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import nlpsandbox +from nlpsandbox.model.text_location_annotation import TextLocationAnnotation +globals()['TextLocationAnnotation'] = TextLocationAnnotation +from nlpsandbox.model.text_location_annotation_response import TextLocationAnnotationResponse + + +class TestTextLocationAnnotationResponse(unittest.TestCase): + """TextLocationAnnotationResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTextLocationAnnotationResponse(self): + """Test TextLocationAnnotationResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = TextLocationAnnotationResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_text_person_name_annotation.py b/test/test_text_person_name_annotation.py index 486c3f97..80aacaa7 100644 --- a/test/test_text_person_name_annotation.py +++ b/test/test_text_person_name_annotation.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Data Node API + NLP Sandbox API - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -13,6 +13,8 @@ import unittest import nlpsandbox +from nlpsandbox.model.text_annotation import TextAnnotation +globals()['TextAnnotation'] = TextAnnotation from nlpsandbox.model.text_person_name_annotation import TextPersonNameAnnotation @@ -27,8 +29,9 @@ def tearDown(self): def testTextPersonNameAnnotation(self): """Test TextPersonNameAnnotation""" - TextPersonNameAnnotation(start=10, length=10, text="foobar", confidence=95.5) - + # FIXME: construct object with mandatory attributes with example values + # model = TextPersonNameAnnotation() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_person_name_annotation_api.py b/test/test_text_person_name_annotation_api.py index 030b4a74..3d72ee4a 100644 --- a/test/test_text_person_name_annotation_api.py +++ b/test/test_text_person_name_annotation_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.text_person_name_annotation_api import TextPersonNameAnnotationApi # noqa: E501 @@ -21,27 +20,16 @@ class TestTextPersonNameAnnotationApi(unittest.TestCase): def setUp(self): self.api = TextPersonNameAnnotationApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_create_text_person_name_annotations(self): """Test case for create_text_person_name_annotations Annotate person names in a clinical note # noqa: E501 """ - self.api.create_text_person_name_annotations( - text_person_name_annotation_request={ - "note": { - "identifier": "note-1", - "type": "note-type", - "text": "my text here", - "patient_id": "patient-1" - } - } - ) + pass if __name__ == '__main__': diff --git a/test/test_text_person_name_annotation_request.py b/test/test_text_person_name_annotation_request.py index 7e9d0203..50d0b3b8 100644 --- a/test/test_text_person_name_annotation_request.py +++ b/test/test_text_person_name_annotation_request.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,7 +14,6 @@ import nlpsandbox from nlpsandbox.model.note import Note -from nlpsandbox.models import NoteId, PatientId globals()['Note'] = Note from nlpsandbox.model.text_person_name_annotation_request import TextPersonNameAnnotationRequest @@ -30,13 +29,9 @@ def tearDown(self): def testTextPersonNameAnnotationRequest(self): """Test TextPersonNameAnnotationRequest""" - TextPersonNameAnnotationRequest( - note=Note( - identifier=NoteId("identifier"), - text="text", type="type", - patient_id=PatientId('patient-1') - ) - ) + # FIXME: construct object with mandatory attributes with example values + # model = TextPersonNameAnnotationRequest() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_person_name_annotation_response.py b/test/test_text_person_name_annotation_response.py index 61e1d95b..22936b94 100644 --- a/test/test_text_person_name_annotation_response.py +++ b/test/test_text_person_name_annotation_response.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -29,11 +29,9 @@ def tearDown(self): def testTextPersonNameAnnotationResponse(self): """Test TextPersonNameAnnotationResponse""" - TextPersonNameAnnotationResponse( - text_person_name_annotations=[ - TextPersonNameAnnotation(start=10, length=10, text="foobar", confidence=95.5) - ] - ) + # FIXME: construct object with mandatory attributes with example values + # model = TextPersonNameAnnotationResponse() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_text_physical_address_annotation.py b/test/test_text_physical_address_annotation.py deleted file mode 100644 index ac50c632..00000000 --- a/test/test_text_physical_address_annotation.py +++ /dev/null @@ -1,40 +0,0 @@ -""" - NLP Sandbox Data Node API - - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 - - The version of the OpenAPI document: 1.1.1 - Contact: team@nlpsandbox.io - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import nlpsandbox -from nlpsandbox.model.text_annotation import TextAnnotation -from nlpsandbox.model.text_physical_address_annotation_all_of import TextPhysicalAddressAnnotationAllOf -globals()['TextAnnotation'] = TextAnnotation -globals()['TextPhysicalAddressAnnotationAllOf'] = TextPhysicalAddressAnnotationAllOf -from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation - - -class TestTextPhysicalAddressAnnotation(unittest.TestCase): - """TextPhysicalAddressAnnotation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTextPhysicalAddressAnnotation(self): - """Test TextPhysicalAddressAnnotation""" - # FIXME: construct object with mandatory attributes with example values - # model = TextPhysicalAddressAnnotation() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_text_physical_address_annotation_all_of.py b/test/test_text_physical_address_annotation_all_of.py deleted file mode 100644 index a7f96afc..00000000 --- a/test/test_text_physical_address_annotation_all_of.py +++ /dev/null @@ -1,34 +0,0 @@ -""" - NLP Sandbox Data Node API - - # Overview The NLP Sandbox Data Node is a repository of data used to benchmark NLP Tools like the NLP Sandbox Date Annotator and Person Name Annotator. The resources that can be stored in this Data Node and the operations supported are listed below: - Create and manage datasets - Create and manage FHIR stores - Store and retrieve FHIR patient profiles - Store and retrieve clinical notes - Create and manage annotation stores - Store and retrieve text annotations # noqa: E501 - - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import nlpsandbox -from nlpsandbox.model.text_physical_address_annotation_all_of import TextPhysicalAddressAnnotationAllOf - - -class TestTextPhysicalAddressAnnotationAllOf(unittest.TestCase): - """TextPhysicalAddressAnnotationAllOf unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTextPhysicalAddressAnnotationAllOf(self): - """Test TextPhysicalAddressAnnotationAllOf""" - TextPhysicalAddressAnnotationAllOf(address_type="city") - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_text_physical_address_annotation_api.py b/test/test_text_physical_address_annotation_api.py deleted file mode 100644 index cf8897fe..00000000 --- a/test/test_text_physical_address_annotation_api.py +++ /dev/null @@ -1,48 +0,0 @@ -""" - NLP Sandbox Date Annotator API - - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 - - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org - Generated by: https://openapi-generator.tech -""" - - -import unittest -from unittest.mock import patch - -import nlpsandbox -from nlpsandbox.api.text_physical_address_annotation_api import TextPhysicalAddressAnnotationApi # noqa: E501 - - -class TestTextPhysicalAddressAnnotationApi(unittest.TestCase): - """TextPhysicalAddressAnnotationApi unit test stubs""" - - def setUp(self): - self.api = TextPhysicalAddressAnnotationApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() - - def tearDown(self): - self.patcher.stop() - - def test_create_text_physical_address_annotations(self): - """Test case for create_text_physical_address_annotations - - Annotate physical addresses in a clinical note # noqa: E501 - """ - self.api.create_text_physical_address_annotations( - text_physical_address_annotation_request={ - "note": { - "identifier": "note-1", - "type": "note-type", - "text": "my text here", - "patient_id": "patient-1" - } - } - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_text_physical_address_annotation_request.py b/test/test_text_physical_address_annotation_request.py deleted file mode 100644 index 44e86416..00000000 --- a/test/test_text_physical_address_annotation_request.py +++ /dev/null @@ -1,43 +0,0 @@ -""" - NLP Sandbox Date Annotator API - - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 - - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import nlpsandbox -from nlpsandbox.model.note import Note -from nlpsandbox.models import NoteId, PatientId -globals()['Note'] = Note -from nlpsandbox.model.text_physical_address_annotation_request import TextPhysicalAddressAnnotationRequest - - -class TestTextPhysicalAddressAnnotationRequest(unittest.TestCase): - """TextPhysicalAddressAnnotationRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTextPhysicalAddressAnnotationRequest(self): - """Test TextPhysicalAddressAnnotationRequest""" - TextPhysicalAddressAnnotationRequest( - note=Note( - identifier=NoteId("identifier"), - text="text", type="type", - patient_id=PatientId('patient-1') - ) - ) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_text_physical_address_annotation_response.py b/test/test_text_physical_address_annotation_response.py deleted file mode 100644 index a05616e6..00000000 --- a/test/test_text_physical_address_annotation_response.py +++ /dev/null @@ -1,38 +0,0 @@ -""" - NLP Sandbox Date Annotator API - - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 - - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org - Generated by: https://openapi-generator.tech -""" - - -import sys -import unittest - -import nlpsandbox -from nlpsandbox.model.text_physical_address_annotation import TextPhysicalAddressAnnotation -globals()['TextPhysicalAddressAnnotation'] = TextPhysicalAddressAnnotation -from nlpsandbox.model.text_physical_address_annotation_response import TextPhysicalAddressAnnotationResponse - - -class TestTextPhysicalAddressAnnotationResponse(unittest.TestCase): - """TextPhysicalAddressAnnotationResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTextPhysicalAddressAnnotationResponse(self): - """Test TextPhysicalAddressAnnotationResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = TextPhysicalAddressAnnotationResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tool.py b/test/test_tool.py index b5cad153..9578129a 100644 --- a/test/test_tool.py +++ b/test/test_tool.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -14,8 +14,10 @@ import nlpsandbox from nlpsandbox.model.license import License +from nlpsandbox.model.programming_language import ProgrammingLanguage from nlpsandbox.model.tool_type import ToolType globals()['License'] = License +globals()['ProgrammingLanguage'] = ProgrammingLanguage globals()['ToolType'] = ToolType from nlpsandbox.model.tool import Tool @@ -31,10 +33,9 @@ def tearDown(self): def testTool(self): """Test Tool""" - Tool(name="foo", version="1.0.0", license=License("apache-2.0"), - repository="www.google.com", description="foobar", - author="Bob", author_email="email@email.com", url="www.google.com", - type=ToolType("tool"), api_version="1.0.0") + # FIXME: construct object with mandatory attributes with example values + # model = Tool() # noqa: E501 + pass if __name__ == '__main__': diff --git a/test/test_tool_api.py b/test/test_tool_api.py index b9c5a3fd..aee3d825 100644 --- a/test/test_tool_api.py +++ b/test/test_tool_api.py @@ -1,16 +1,15 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import unittest -from unittest.mock import patch import nlpsandbox from nlpsandbox.api.tool_api import ToolApi # noqa: E501 @@ -21,25 +20,23 @@ class TestToolApi(unittest.TestCase): def setUp(self): self.api = ToolApi() # noqa: E501 - self.patcher = patch('nlpsandbox.api_client.ApiClient.call_api') - self.mock_foo = self.patcher.start() def tearDown(self): - self.patcher.stop() + pass def test_get_tool(self): """Test case for get_tool Get tool information # noqa: E501 """ - self.api.get_tool() + pass def test_get_tool_dependencies(self): """Test case for get_tool_dependencies Get tool dependencies # noqa: E501 """ - self.api.get_tool_dependencies() + pass if __name__ == '__main__': diff --git a/test/test_tool_dependencies.py b/test/test_tool_dependencies.py index 25c68edb..9e8eaf20 100644 --- a/test/test_tool_dependencies.py +++ b/test/test_tool_dependencies.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.1.1 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ diff --git a/test/test_tool_type.py b/test/test_tool_type.py index 34769749..450b835d 100644 --- a/test/test_tool_type.py +++ b/test/test_tool_type.py @@ -1,10 +1,10 @@ """ - NLP Sandbox Date Annotator API + NLP Sandbox API - # Overview The OpenAPI specification implemented by NLP Sandbox Annotators. # noqa: E501 + NLP Sandbox REST API # noqa: E501 - The version of the OpenAPI document: 1.0.2 - Contact: thomas.schaffter@sagebionetworks.org + The version of the OpenAPI document: 1.2.0 + Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ @@ -27,7 +27,9 @@ def tearDown(self): def testToolType(self): """Test ToolType""" - ToolType("type") + # FIXME: construct object with mandatory attributes with example values + # model = ToolType() # noqa: E501 + pass if __name__ == '__main__':