diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0b8fc38..a076ade 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,7 +1,6 @@ .github/workflows/python.yml .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md docs/ArgoApi.md @@ -18,6 +17,7 @@ docs/HydroShareMetadata.md docs/HydroshareApi.md docs/LogsResponseModel.md docs/MinioApi.md +docs/NWMVersionEnum.md docs/OAuth2AuthorizeResponse.md docs/PhaseEnum.md docs/Submission.md @@ -53,6 +53,7 @@ openapi_client/models/geo_json_geometry.py openapi_client/models/http_validation_error.py openapi_client/models/hydro_share_metadata.py openapi_client/models/logs_response_model.py +openapi_client/models/nwm_version_enum.py openapi_client/models/o_auth2_authorize_response.py openapi_client/models/phase_enum.py openapi_client/models/submission.py @@ -70,29 +71,5 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_argo_api.py -test/test_auth_api.py -test/test_dataset_metadata_request_model.py -test/test_detail.py -test/test_error_model.py -test/test_extract_metadata_request_body.py -test/test_geo_json_feature.py -test/test_geo_json_feature_collection.py -test/test_geo_json_geometry.py -test/test_http_validation_error.py -test/test_hydro_share_metadata.py -test/test_hydroshare_api.py -test/test_logs_response_model.py -test/test_minio_api.py -test/test_o_auth2_authorize_response.py -test/test_phase_enum.py -test/test_submission.py -test/test_submission_response_model.py -test/test_user_read.py -test/test_user_submissions_response_model.py -test/test_user_update.py -test/test_users_api.py -test/test_utilities_api.py -test/test_validation_error.py -test/test_validation_error_loc_inner.py +test/test_nwm_version_enum.py tox.ini diff --git a/README.md b/README.md index fca31a8..2600c80 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,6 @@ Class | Method | HTTP request | Description *ArgoApi* | [**refresh_workflow_refresh_get**](docs/ArgoApi.md#refresh_workflow_refresh_get) | **GET** /refresh | Refresh Workflow *ArgoApi* | [**refresh_workflow_refresh_workflow_id_get**](docs/ArgoApi.md#refresh_workflow_refresh_workflow_id_get) | **GET** /refresh/{workflow_id} | Refresh Workflow *ArgoApi* | [**submissions_submissions_get**](docs/ArgoApi.md#submissions_submissions_get) | **GET** /submissions | Submissions -*ArgoApi* | [**submit_nwm1_submit_nwm1_post**](docs/ArgoApi.md#submit_nwm1_submit_nwm1_post) | **POST** /submit/nwm1 | Submit Nwm1 -*ArgoApi* | [**submit_nwm2_submit_nwm2_post**](docs/ArgoApi.md#submit_nwm2_submit_nwm2_post) | **POST** /submit/nwm2 | Submit Nwm2 *ArgoApi* | [**submit_nwm_submit_nwm_post**](docs/ArgoApi.md#submit_nwm_submit_nwm_post) | **POST** /submit/nwm | Submit Nwm *ArgoApi* | [**submit_parflow_submit_parflow_post**](docs/ArgoApi.md#submit_parflow_submit_parflow_post) | **POST** /submit/parflow | Submit Parflow *AuthApi* | [**oauth_oauth2_jwt_authorize_auth_cuahsi_authorize_get**](docs/AuthApi.md#oauth_oauth2_jwt_authorize_auth_cuahsi_authorize_get) | **GET** /auth/cuahsi/authorize | Oauth:Oauth2.Jwt.Authorize @@ -142,6 +140,7 @@ Class | Method | HTTP request | Description - [HTTPValidationError](docs/HTTPValidationError.md) - [HydroShareMetadata](docs/HydroShareMetadata.md) - [LogsResponseModel](docs/LogsResponseModel.md) + - [NWMVersionEnum](docs/NWMVersionEnum.md) - [OAuth2AuthorizeResponse](docs/OAuth2AuthorizeResponse.md) - [PhaseEnum](docs/PhaseEnum.md) - [Submission](docs/Submission.md) diff --git a/docs/ArgoApi.md b/docs/ArgoApi.md index d10ff8a..29b4a14 100644 --- a/docs/ArgoApi.md +++ b/docs/ArgoApi.md @@ -10,8 +10,6 @@ Method | HTTP request | Description [**refresh_workflow_refresh_get**](ArgoApi.md#refresh_workflow_refresh_get) | **GET** /refresh | Refresh Workflow [**refresh_workflow_refresh_workflow_id_get**](ArgoApi.md#refresh_workflow_refresh_workflow_id_get) | **GET** /refresh/{workflow_id} | Refresh Workflow [**submissions_submissions_get**](ArgoApi.md#submissions_submissions_get) | **GET** /submissions | Submissions -[**submit_nwm1_submit_nwm1_post**](ArgoApi.md#submit_nwm1_submit_nwm1_post) | **POST** /submit/nwm1 | Submit Nwm1 -[**submit_nwm2_submit_nwm2_post**](ArgoApi.md#submit_nwm2_submit_nwm2_post) | **POST** /submit/nwm2 | Submit Nwm2 [**submit_nwm_submit_nwm_post**](ArgoApi.md#submit_nwm_submit_nwm_post) | **POST** /submit/nwm | Submit Nwm [**submit_parflow_submit_parflow_post**](ArgoApi.md#submit_parflow_submit_parflow_post) | **POST** /submit/parflow | Submit Parflow @@ -449,166 +447,6 @@ This endpoint does not need any parameter. [[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) -# **submit_nwm1_submit_nwm1_post** -> SubmissionResponseModel submit_nwm1_submit_nwm1_post(y_south, x_west, y_north, x_east) - -Submit Nwm1 - -### Example - -* OAuth Authentication (OAuth2PasswordBearer): - -```python -import openapi_client -from openapi_client.models.submission_response_model import SubmissionResponseModel -from openapi_client.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://subsetter-api-jbzfw6l52q-uc.a.run.app -# See configuration.py for a list of all supported configuration parameters. -configuration = openapi_client.Configuration( - host = "https://subsetter-api-jbzfw6l52q-uc.a.run.app" -) - -# 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. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Enter a context with an instance of the API client -with openapi_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = openapi_client.ArgoApi(api_client) - y_south = 3.4 # float | - x_west = 3.4 # float | - y_north = 3.4 # float | - x_east = 3.4 # float | - - try: - # Submit Nwm1 - api_response = api_instance.submit_nwm1_submit_nwm1_post(y_south, x_west, y_north, x_east) - print("The response of ArgoApi->submit_nwm1_submit_nwm1_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ArgoApi->submit_nwm1_submit_nwm1_post: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **y_south** | **float**| | - **x_west** | **float**| | - **y_north** | **float**| | - **x_east** | **float**| | - -### Return type - -[**SubmissionResponseModel**](SubmissionResponseModel.md) - -### Authorization - -[OAuth2PasswordBearer](../README.md#OAuth2PasswordBearer) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[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) - -# **submit_nwm2_submit_nwm2_post** -> SubmissionResponseModel submit_nwm2_submit_nwm2_post(y_south, x_west, y_north, x_east) - -Submit Nwm2 - -### Example - -* OAuth Authentication (OAuth2PasswordBearer): - -```python -import openapi_client -from openapi_client.models.submission_response_model import SubmissionResponseModel -from openapi_client.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://subsetter-api-jbzfw6l52q-uc.a.run.app -# See configuration.py for a list of all supported configuration parameters. -configuration = openapi_client.Configuration( - host = "https://subsetter-api-jbzfw6l52q-uc.a.run.app" -) - -# 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. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Enter a context with an instance of the API client -with openapi_client.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = openapi_client.ArgoApi(api_client) - y_south = 3.4 # float | - x_west = 3.4 # float | - y_north = 3.4 # float | - x_east = 3.4 # float | - - try: - # Submit Nwm2 - api_response = api_instance.submit_nwm2_submit_nwm2_post(y_south, x_west, y_north, x_east) - print("The response of ArgoApi->submit_nwm2_submit_nwm2_post:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling ArgoApi->submit_nwm2_submit_nwm2_post: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **y_south** | **float**| | - **x_west** | **float**| | - **y_north** | **float**| | - **x_east** | **float**| | - -### Return type - -[**SubmissionResponseModel**](SubmissionResponseModel.md) - -### Authorization - -[OAuth2PasswordBearer](../README.md#OAuth2PasswordBearer) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[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) - # **submit_nwm_submit_nwm_post** > SubmissionResponseModel submit_nwm_submit_nwm_post(y_south, x_west, y_north, x_east, model_version) @@ -620,6 +458,7 @@ Submit Nwm ```python import openapi_client +from openapi_client.models.nwm_version_enum import NWMVersionEnum from openapi_client.models.submission_response_model import SubmissionResponseModel from openapi_client.rest import ApiException from pprint import pprint @@ -645,7 +484,7 @@ with openapi_client.ApiClient(configuration) as api_client: x_west = 3.4 # float | y_north = 3.4 # float | x_east = 3.4 # float | - model_version = 'model_version_example' # str | + model_version = openapi_client.NWMVersionEnum() # NWMVersionEnum | try: # Submit Nwm @@ -667,7 +506,7 @@ Name | Type | Description | Notes **x_west** | **float**| | **y_north** | **float**| | **x_east** | **float**| | - **model_version** | **str**| | + **model_version** | [**NWMVersionEnum**](.md)| | ### Return type diff --git a/docs/NWMVersionEnum.md b/docs/NWMVersionEnum.md new file mode 100644 index 0000000..fdb2f54 --- /dev/null +++ b/docs/NWMVersionEnum.md @@ -0,0 +1,14 @@ +# NWMVersionEnum + + +## Enum + +* `NWM1` (value: `'nwm1'`) + +* `NWM2` (value: `'nwm2'`) + +* `NWM3` (value: `'nwm3'`) + +[[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/openapi_client/__init__.py b/openapi_client/__init__.py index 87f1b39..bdc7499 100644 --- a/openapi_client/__init__.py +++ b/openapi_client/__init__.py @@ -46,6 +46,7 @@ from openapi_client.models.http_validation_error import HTTPValidationError from openapi_client.models.hydro_share_metadata import HydroShareMetadata from openapi_client.models.logs_response_model import LogsResponseModel +from openapi_client.models.nwm_version_enum import NWMVersionEnum from openapi_client.models.o_auth2_authorize_response import OAuth2AuthorizeResponse from openapi_client.models.phase_enum import PhaseEnum from openapi_client.models.submission import Submission diff --git a/openapi_client/api/argo_api.py b/openapi_client/api/argo_api.py index 045c8d4..03c3df0 100644 --- a/openapi_client/api/argo_api.py +++ b/openapi_client/api/argo_api.py @@ -21,6 +21,7 @@ from typing_extensions import Annotated from openapi_client.models.extract_metadata_request_body import ExtractMetadataRequestBody from openapi_client.models.logs_response_model import LogsResponseModel +from openapi_client.models.nwm_version_enum import NWMVersionEnum from openapi_client.models.submission_response_model import SubmissionResponseModel from openapi_client.models.user_submissions_response_model import UserSubmissionsResponseModel @@ -1588,634 +1589,6 @@ def _submissions_submissions_get_serialize( - @validate_call - def submit_nwm1_submit_nwm1_post( - self, - y_south: Union[StrictFloat, StrictInt], - x_west: Union[StrictFloat, StrictInt], - y_north: Union[StrictFloat, StrictInt], - x_east: Union[StrictFloat, StrictInt], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SubmissionResponseModel: - """Submit Nwm1 - - - :param y_south: (required) - :type y_south: float - :param x_west: (required) - :type x_west: float - :param y_north: (required) - :type y_north: float - :param x_east: (required) - :type x_east: float - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._submit_nwm1_submit_nwm1_post_serialize( - y_south=y_south, - x_west=x_west, - y_north=y_north, - x_east=x_east, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SubmissionResponseModel", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def submit_nwm1_submit_nwm1_post_with_http_info( - self, - y_south: Union[StrictFloat, StrictInt], - x_west: Union[StrictFloat, StrictInt], - y_north: Union[StrictFloat, StrictInt], - x_east: Union[StrictFloat, StrictInt], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SubmissionResponseModel]: - """Submit Nwm1 - - - :param y_south: (required) - :type y_south: float - :param x_west: (required) - :type x_west: float - :param y_north: (required) - :type y_north: float - :param x_east: (required) - :type x_east: float - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._submit_nwm1_submit_nwm1_post_serialize( - y_south=y_south, - x_west=x_west, - y_north=y_north, - x_east=x_east, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SubmissionResponseModel", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def submit_nwm1_submit_nwm1_post_without_preload_content( - self, - y_south: Union[StrictFloat, StrictInt], - x_west: Union[StrictFloat, StrictInt], - y_north: Union[StrictFloat, StrictInt], - x_east: Union[StrictFloat, StrictInt], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Submit Nwm1 - - - :param y_south: (required) - :type y_south: float - :param x_west: (required) - :type x_west: float - :param y_north: (required) - :type y_north: float - :param x_east: (required) - :type x_east: float - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._submit_nwm1_submit_nwm1_post_serialize( - y_south=y_south, - x_west=x_west, - y_north=y_north, - x_east=x_east, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SubmissionResponseModel", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _submit_nwm1_submit_nwm1_post_serialize( - self, - y_south, - x_west, - y_north, - x_east, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if y_south is not None: - - _query_params.append(('y_south', y_south)) - - if x_west is not None: - - _query_params.append(('x_west', x_west)) - - if y_north is not None: - - _query_params.append(('y_north', y_north)) - - if x_east is not None: - - _query_params.append(('x_east', x_east)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'OAuth2PasswordBearer' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/submit/nwm1', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def submit_nwm2_submit_nwm2_post( - self, - y_south: Union[StrictFloat, StrictInt], - x_west: Union[StrictFloat, StrictInt], - y_north: Union[StrictFloat, StrictInt], - x_east: Union[StrictFloat, StrictInt], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SubmissionResponseModel: - """Submit Nwm2 - - - :param y_south: (required) - :type y_south: float - :param x_west: (required) - :type x_west: float - :param y_north: (required) - :type y_north: float - :param x_east: (required) - :type x_east: float - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._submit_nwm2_submit_nwm2_post_serialize( - y_south=y_south, - x_west=x_west, - y_north=y_north, - x_east=x_east, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SubmissionResponseModel", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def submit_nwm2_submit_nwm2_post_with_http_info( - self, - y_south: Union[StrictFloat, StrictInt], - x_west: Union[StrictFloat, StrictInt], - y_north: Union[StrictFloat, StrictInt], - x_east: Union[StrictFloat, StrictInt], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SubmissionResponseModel]: - """Submit Nwm2 - - - :param y_south: (required) - :type y_south: float - :param x_west: (required) - :type x_west: float - :param y_north: (required) - :type y_north: float - :param x_east: (required) - :type x_east: float - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._submit_nwm2_submit_nwm2_post_serialize( - y_south=y_south, - x_west=x_west, - y_north=y_north, - x_east=x_east, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SubmissionResponseModel", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def submit_nwm2_submit_nwm2_post_without_preload_content( - self, - y_south: Union[StrictFloat, StrictInt], - x_west: Union[StrictFloat, StrictInt], - y_north: Union[StrictFloat, StrictInt], - x_east: Union[StrictFloat, StrictInt], - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Submit Nwm2 - - - :param y_south: (required) - :type y_south: float - :param x_west: (required) - :type x_west: float - :param y_north: (required) - :type y_north: float - :param x_east: (required) - :type x_east: float - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._submit_nwm2_submit_nwm2_post_serialize( - y_south=y_south, - x_west=x_west, - y_north=y_north, - x_east=x_east, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SubmissionResponseModel", - '422': "HTTPValidationError", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _submit_nwm2_submit_nwm2_post_serialize( - self, - y_south, - x_west, - y_north, - x_east, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if y_south is not None: - - _query_params.append(('y_south', y_south)) - - if x_west is not None: - - _query_params.append(('x_west', x_west)) - - if y_north is not None: - - _query_params.append(('y_north', y_north)) - - if x_east is not None: - - _query_params.append(('x_east', x_east)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - 'OAuth2PasswordBearer' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/submit/nwm2', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call def submit_nwm_submit_nwm_post( self, @@ -2223,7 +1596,7 @@ def submit_nwm_submit_nwm_post( x_west: Union[StrictFloat, StrictInt], y_north: Union[StrictFloat, StrictInt], x_east: Union[StrictFloat, StrictInt], - model_version: StrictStr, + model_version: NWMVersionEnum, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2249,7 +1622,7 @@ def submit_nwm_submit_nwm_post( :param x_east: (required) :type x_east: float :param model_version: (required) - :type model_version: str + :type model_version: NWMVersionEnum :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2306,7 +1679,7 @@ def submit_nwm_submit_nwm_post_with_http_info( x_west: Union[StrictFloat, StrictInt], y_north: Union[StrictFloat, StrictInt], x_east: Union[StrictFloat, StrictInt], - model_version: StrictStr, + model_version: NWMVersionEnum, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2332,7 +1705,7 @@ def submit_nwm_submit_nwm_post_with_http_info( :param x_east: (required) :type x_east: float :param model_version: (required) - :type model_version: str + :type model_version: NWMVersionEnum :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2389,7 +1762,7 @@ def submit_nwm_submit_nwm_post_without_preload_content( x_west: Union[StrictFloat, StrictInt], y_north: Union[StrictFloat, StrictInt], x_east: Union[StrictFloat, StrictInt], - model_version: StrictStr, + model_version: NWMVersionEnum, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2415,7 +1788,7 @@ def submit_nwm_submit_nwm_post_without_preload_content( :param x_east: (required) :type x_east: float :param model_version: (required) - :type model_version: str + :type model_version: NWMVersionEnum :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2508,7 +1881,7 @@ def _submit_nwm_submit_nwm_post_serialize( if model_version is not None: - _query_params.append(('model_version', model_version)) + _query_params.append(('model_version', model_version.value)) # process the header parameters # process the form parameters diff --git a/openapi_client/models/__init__.py b/openapi_client/models/__init__.py index d871717..a013f81 100644 --- a/openapi_client/models/__init__.py +++ b/openapi_client/models/__init__.py @@ -24,6 +24,7 @@ from openapi_client.models.http_validation_error import HTTPValidationError from openapi_client.models.hydro_share_metadata import HydroShareMetadata from openapi_client.models.logs_response_model import LogsResponseModel +from openapi_client.models.nwm_version_enum import NWMVersionEnum from openapi_client.models.o_auth2_authorize_response import OAuth2AuthorizeResponse from openapi_client.models.phase_enum import PhaseEnum from openapi_client.models.submission import Submission diff --git a/openapi_client/models/nwm_version_enum.py b/openapi_client/models/nwm_version_enum.py new file mode 100644 index 0000000..bd85160 --- /dev/null +++ b/openapi_client/models/nwm_version_enum.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + FastAPI + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class NWMVersionEnum(str, Enum): + """ + NWMVersionEnum + """ + + """ + allowed enum values + """ + NWM1 = 'nwm1' + NWM2 = 'nwm2' + NWM3 = 'nwm3' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of NWMVersionEnum from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/test/test_nwm_version_enum.py b/test/test_nwm_version_enum.py new file mode 100644 index 0000000..188f014 --- /dev/null +++ b/test/test_nwm_version_enum.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + FastAPI + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from openapi_client.models.nwm_version_enum import NWMVersionEnum + +class TestNWMVersionEnum(unittest.TestCase): + """NWMVersionEnum unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNWMVersionEnum(self): + """Test NWMVersionEnum""" + # inst = NWMVersionEnum() + +if __name__ == '__main__': + unittest.main()