From f67f0a9c068d308dc008f9734cbb8eeb31603d81 Mon Sep 17 00:00:00 2001 From: platform CI Date: Fri, 4 Apr 2025 15:19:28 +0000 Subject: [PATCH] Update clients to latest platform release (3.2.7) --- README.md | 7 +- docs/EXTERNALApi.md | 324 +++++ docs/UpdateDeploymentResponse.md | 31 + platform_api_python_client/__init__.py | 3 +- .../api/external_api.py | 1229 ++++++++++++++++- platform_api_python_client/api_client.py | 2 +- platform_api_python_client/configuration.py | 2 +- platform_api_python_client/models/__init__.py | 1 + .../models/update_deployment_response.py | 92 ++ pyproject.toml | 2 +- setup.py | 2 +- test/test_external_api.py | 35 + test/test_update_deployment_response.py | 56 + 13 files changed, 1748 insertions(+), 38 deletions(-) create mode 100644 docs/UpdateDeploymentResponse.md create mode 100644 platform_api_python_client/models/update_deployment_response.py create mode 100644 test/test_update_deployment_response.py diff --git a/README.md b/README.md index 5c2b1c6..1a6f2be 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.1.0 -- Package version: 3.2.5 +- Package version: 3.2.7 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -130,7 +130,11 @@ Class | Method | HTTP request | Description *EXTERNALApi* | [**get_usage_deployments_usage_deployment_id_get**](docs/EXTERNALApi.md#get_usage_deployments_usage_deployment_id_get) | **GET** /deployments/usage/{deployment_id} | Get Usage *EXTERNALApi* | [**setup_stripe_customer_payments_setup_post**](docs/EXTERNALApi.md#setup_stripe_customer_payments_setup_post) | **POST** /payments/setup | Setup Stripe Customer *EXTERNALApi* | [**update_autocharge_preferences_autocharge_preferences_put**](docs/EXTERNALApi.md#update_autocharge_preferences_autocharge_preferences_put) | **PUT** /autocharge/preferences | Update Autocharge Preferences +*EXTERNALApi* | [**update_compute_deployment_deployments_compute_put**](docs/EXTERNALApi.md#update_compute_deployment_deployments_compute_put) | **PUT** /deployments/compute | Update Compute Deployment +*EXTERNALApi* | [**update_cserve_v2_deployment_deployments_cserve_v2_put**](docs/EXTERNALApi.md#update_cserve_v2_deployment_deployments_cserve_v2_put) | **PUT** /deployments/cserve_v2 | Update Cserve V2 Deployment *EXTERNALApi* | [**update_deployment_status_deployments_status_deployment_id_put**](docs/EXTERNALApi.md#update_deployment_status_deployments_status_deployment_id_put) | **PUT** /deployments/status/{deployment_id} | Update Deployment Status +*EXTERNALApi* | [**update_inference_deployment_deployments_inference_put**](docs/EXTERNALApi.md#update_inference_deployment_deployments_inference_put) | **PUT** /deployments/inference | Update Inference Deployment +*EXTERNALApi* | [**update_rag_deployment_deployments_rag_put**](docs/EXTERNALApi.md#update_rag_deployment_deployments_rag_put) | **PUT** /deployments/rag | Update Rag Deployment *EXTERNALApi* | [**update_user_vault_item_endpoint_user_vault_put**](docs/EXTERNALApi.md#update_user_vault_item_endpoint_user_vault_put) | **PUT** /user_vault | Update User Vault Item Endpoint *EXTERNALApi* | [**upload_url_file_url_upload_post**](docs/EXTERNALApi.md#upload_url_file_url_upload_post) | **POST** /file_url/upload | Upload Url @@ -192,6 +196,7 @@ Class | Method | HTTP request | Description - [PrebuiltImageResponse](docs/PrebuiltImageResponse.md) - [ServiceStatus](docs/ServiceStatus.md) - [UpdateAutochargePreferencesRequest](docs/UpdateAutochargePreferencesRequest.md) + - [UpdateDeploymentResponse](docs/UpdateDeploymentResponse.md) - [UserSupportEmailRequest](docs/UserSupportEmailRequest.md) - [UserVaultItem](docs/UserVaultItem.md) - [UserVaultType](docs/UserVaultType.md) diff --git a/docs/EXTERNALApi.md b/docs/EXTERNALApi.md index d3fe101..c19e1f5 100644 --- a/docs/EXTERNALApi.md +++ b/docs/EXTERNALApi.md @@ -40,7 +40,11 @@ Method | HTTP request | Description [**get_usage_deployments_usage_deployment_id_get**](EXTERNALApi.md#get_usage_deployments_usage_deployment_id_get) | **GET** /deployments/usage/{deployment_id} | Get Usage [**setup_stripe_customer_payments_setup_post**](EXTERNALApi.md#setup_stripe_customer_payments_setup_post) | **POST** /payments/setup | Setup Stripe Customer [**update_autocharge_preferences_autocharge_preferences_put**](EXTERNALApi.md#update_autocharge_preferences_autocharge_preferences_put) | **PUT** /autocharge/preferences | Update Autocharge Preferences +[**update_compute_deployment_deployments_compute_put**](EXTERNALApi.md#update_compute_deployment_deployments_compute_put) | **PUT** /deployments/compute | Update Compute Deployment +[**update_cserve_v2_deployment_deployments_cserve_v2_put**](EXTERNALApi.md#update_cserve_v2_deployment_deployments_cserve_v2_put) | **PUT** /deployments/cserve_v2 | Update Cserve V2 Deployment [**update_deployment_status_deployments_status_deployment_id_put**](EXTERNALApi.md#update_deployment_status_deployments_status_deployment_id_put) | **PUT** /deployments/status/{deployment_id} | Update Deployment Status +[**update_inference_deployment_deployments_inference_put**](EXTERNALApi.md#update_inference_deployment_deployments_inference_put) | **PUT** /deployments/inference | Update Inference Deployment +[**update_rag_deployment_deployments_rag_put**](EXTERNALApi.md#update_rag_deployment_deployments_rag_put) | **PUT** /deployments/rag | Update Rag Deployment [**update_user_vault_item_endpoint_user_vault_put**](EXTERNALApi.md#update_user_vault_item_endpoint_user_vault_put) | **PUT** /user_vault | Update User Vault Item Endpoint [**upload_url_file_url_upload_post**](EXTERNALApi.md#upload_url_file_url_upload_post) | **POST** /file_url/upload | Upload Url @@ -2815,6 +2819,166 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_compute_deployment_deployments_compute_put** +> UpdateDeploymentResponse update_compute_deployment_deployments_compute_put(deployment_id, create_compute_deployment_request) + +Update Compute Deployment + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.create_compute_deployment_request import CreateComputeDeploymentRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse +from platform_api_python_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = platform_api_python_client.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: HTTPBearer +configuration = platform_api_python_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with platform_api_python_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = platform_api_python_client.EXTERNALApi(api_client) + deployment_id = 56 # int | + create_compute_deployment_request = platform_api_python_client.CreateComputeDeploymentRequest() # CreateComputeDeploymentRequest | + + try: + # Update Compute Deployment + api_response = api_instance.update_compute_deployment_deployments_compute_put(deployment_id, create_compute_deployment_request) + print("The response of EXTERNALApi->update_compute_deployment_deployments_compute_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->update_compute_deployment_deployments_compute_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deployment_id** | **int**| | + **create_compute_deployment_request** | [**CreateComputeDeploymentRequest**](CreateComputeDeploymentRequest.md)| | + +### Return type + +[**UpdateDeploymentResponse**](UpdateDeploymentResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **update_cserve_v2_deployment_deployments_cserve_v2_put** +> UpdateDeploymentResponse update_cserve_v2_deployment_deployments_cserve_v2_put(deployment_id, create_c_serve_v2_deployment_request) + +Update Cserve V2 Deployment + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.create_c_serve_v2_deployment_request import CreateCServeV2DeploymentRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse +from platform_api_python_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = platform_api_python_client.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: HTTPBearer +configuration = platform_api_python_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with platform_api_python_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = platform_api_python_client.EXTERNALApi(api_client) + deployment_id = 56 # int | + create_c_serve_v2_deployment_request = platform_api_python_client.CreateCServeV2DeploymentRequest() # CreateCServeV2DeploymentRequest | + + try: + # Update Cserve V2 Deployment + api_response = api_instance.update_cserve_v2_deployment_deployments_cserve_v2_put(deployment_id, create_c_serve_v2_deployment_request) + print("The response of EXTERNALApi->update_cserve_v2_deployment_deployments_cserve_v2_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->update_cserve_v2_deployment_deployments_cserve_v2_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deployment_id** | **int**| | + **create_c_serve_v2_deployment_request** | [**CreateCServeV2DeploymentRequest**](CreateCServeV2DeploymentRequest.md)| | + +### Return type + +[**UpdateDeploymentResponse**](UpdateDeploymentResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + # **update_deployment_status_deployments_status_deployment_id_put** > DeploymentStatusResponse update_deployment_status_deployments_status_deployment_id_put(deployment_id, deployment_status_request) @@ -2895,6 +3059,166 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **update_inference_deployment_deployments_inference_put** +> UpdateDeploymentResponse update_inference_deployment_deployments_inference_put(deployment_id, create_inference_deployment_request) + +Update Inference Deployment + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse +from platform_api_python_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = platform_api_python_client.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: HTTPBearer +configuration = platform_api_python_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with platform_api_python_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = platform_api_python_client.EXTERNALApi(api_client) + deployment_id = 56 # int | + create_inference_deployment_request = platform_api_python_client.CreateInferenceDeploymentRequest() # CreateInferenceDeploymentRequest | + + try: + # Update Inference Deployment + api_response = api_instance.update_inference_deployment_deployments_inference_put(deployment_id, create_inference_deployment_request) + print("The response of EXTERNALApi->update_inference_deployment_deployments_inference_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->update_inference_deployment_deployments_inference_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deployment_id** | **int**| | + **create_inference_deployment_request** | [**CreateInferenceDeploymentRequest**](CreateInferenceDeploymentRequest.md)| | + +### Return type + +[**UpdateDeploymentResponse**](UpdateDeploymentResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **update_rag_deployment_deployments_rag_put** +> UpdateDeploymentResponse update_rag_deployment_deployments_rag_put(deployment_id, create_rag_deployment_request) + +Update Rag Deployment + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.create_rag_deployment_request import CreateRagDeploymentRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse +from platform_api_python_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to http://localhost +# See configuration.py for a list of all supported configuration parameters. +configuration = platform_api_python_client.Configuration( + host = "http://localhost" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: HTTPBearer +configuration = platform_api_python_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with platform_api_python_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = platform_api_python_client.EXTERNALApi(api_client) + deployment_id = 56 # int | + create_rag_deployment_request = platform_api_python_client.CreateRagDeploymentRequest() # CreateRagDeploymentRequest | + + try: + # Update Rag Deployment + api_response = api_instance.update_rag_deployment_deployments_rag_put(deployment_id, create_rag_deployment_request) + print("The response of EXTERNALApi->update_rag_deployment_deployments_rag_put:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->update_rag_deployment_deployments_rag_put: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **deployment_id** | **int**| | + **create_rag_deployment_request** | [**CreateRagDeploymentRequest**](CreateRagDeploymentRequest.md)| | + +### Return type + +[**UpdateDeploymentResponse**](UpdateDeploymentResponse.md) + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + # **update_user_vault_item_endpoint_user_vault_put** > object update_user_vault_item_endpoint_user_vault_put(user_vault_item) diff --git a/docs/UpdateDeploymentResponse.md b/docs/UpdateDeploymentResponse.md new file mode 100644 index 0000000..ba86bce --- /dev/null +++ b/docs/UpdateDeploymentResponse.md @@ -0,0 +1,31 @@ +# UpdateDeploymentResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**endpoint_url** | **str** | | +**updated_at** | **datetime** | | + +## Example + +```python +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateDeploymentResponse from a JSON string +update_deployment_response_instance = UpdateDeploymentResponse.from_json(json) +# print the JSON string representation of the object +print(UpdateDeploymentResponse.to_json()) + +# convert the object into a dict +update_deployment_response_dict = update_deployment_response_instance.to_dict() +# create an instance of UpdateDeploymentResponse from a dict +update_deployment_response_from_dict = UpdateDeploymentResponse.from_dict(update_deployment_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/platform_api_python_client/__init__.py b/platform_api_python_client/__init__.py index 2e2f0bd..f5b1b23 100644 --- a/platform_api_python_client/__init__.py +++ b/platform_api_python_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "3.2.5" +__version__ = "3.2.7" # import apis into sdk package from platform_api_python_client.api.external_api import EXTERNALApi @@ -86,6 +86,7 @@ from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse from platform_api_python_client.models.service_status import ServiceStatus from platform_api_python_client.models.update_autocharge_preferences_request import UpdateAutochargePreferencesRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.models.user_support_email_request import UserSupportEmailRequest from platform_api_python_client.models.user_vault_item import UserVaultItem from platform_api_python_client.models.user_vault_type import UserVaultType diff --git a/platform_api_python_client/api/external_api.py b/platform_api_python_client/api/external_api.py index 1542bc0..dc2f206 100644 --- a/platform_api_python_client/api/external_api.py +++ b/platform_api_python_client/api/external_api.py @@ -60,6 +60,7 @@ from platform_api_python_client.models.metric import Metric from platform_api_python_client.models.payment_method_response import PaymentMethodResponse from platform_api_python_client.models.update_autocharge_preferences_request import UpdateAutochargePreferencesRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.models.user_support_email_request import UserSupportEmailRequest from platform_api_python_client.models.user_vault_item import UserVaultItem from platform_api_python_client.models.user_vault_type import UserVaultType @@ -9763,11 +9764,1024 @@ def _update_autocharge_preferences_autocharge_preferences_put_serialize( + @validate_call + def update_compute_deployment_deployments_compute_put( + self, + deployment_id: StrictInt, + create_compute_deployment_request: CreateComputeDeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateDeploymentResponse: + """Update Compute Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_compute_deployment_request: (required) + :type create_compute_deployment_request: CreateComputeDeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_compute_deployment_deployments_compute_put_serialize( + deployment_id=deployment_id, + create_compute_deployment_request=create_compute_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '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 update_compute_deployment_deployments_compute_put_with_http_info( + self, + deployment_id: StrictInt, + create_compute_deployment_request: CreateComputeDeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[UpdateDeploymentResponse]: + """Update Compute Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_compute_deployment_request: (required) + :type create_compute_deployment_request: CreateComputeDeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_compute_deployment_deployments_compute_put_serialize( + deployment_id=deployment_id, + create_compute_deployment_request=create_compute_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '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 update_compute_deployment_deployments_compute_put_without_preload_content( + self, + deployment_id: StrictInt, + create_compute_deployment_request: CreateComputeDeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Compute Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_compute_deployment_request: (required) + :type create_compute_deployment_request: CreateComputeDeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_compute_deployment_deployments_compute_put_serialize( + deployment_id=deployment_id, + create_compute_deployment_request=create_compute_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_compute_deployment_deployments_compute_put_serialize( + self, + deployment_id, + create_compute_deployment_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if deployment_id is not None: + + _query_params.append(('deployment_id', deployment_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_compute_deployment_request is not None: + _body_params = create_compute_deployment_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/deployments/compute', + 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 update_cserve_v2_deployment_deployments_cserve_v2_put( + self, + deployment_id: StrictInt, + create_c_serve_v2_deployment_request: CreateCServeV2DeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateDeploymentResponse: + """Update Cserve V2 Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_c_serve_v2_deployment_request: (required) + :type create_c_serve_v2_deployment_request: CreateCServeV2DeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_cserve_v2_deployment_deployments_cserve_v2_put_serialize( + deployment_id=deployment_id, + create_c_serve_v2_deployment_request=create_c_serve_v2_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '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 update_cserve_v2_deployment_deployments_cserve_v2_put_with_http_info( + self, + deployment_id: StrictInt, + create_c_serve_v2_deployment_request: CreateCServeV2DeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[UpdateDeploymentResponse]: + """Update Cserve V2 Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_c_serve_v2_deployment_request: (required) + :type create_c_serve_v2_deployment_request: CreateCServeV2DeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_cserve_v2_deployment_deployments_cserve_v2_put_serialize( + deployment_id=deployment_id, + create_c_serve_v2_deployment_request=create_c_serve_v2_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '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 update_cserve_v2_deployment_deployments_cserve_v2_put_without_preload_content( + self, + deployment_id: StrictInt, + create_c_serve_v2_deployment_request: CreateCServeV2DeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Cserve V2 Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_c_serve_v2_deployment_request: (required) + :type create_c_serve_v2_deployment_request: CreateCServeV2DeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_cserve_v2_deployment_deployments_cserve_v2_put_serialize( + deployment_id=deployment_id, + create_c_serve_v2_deployment_request=create_c_serve_v2_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_cserve_v2_deployment_deployments_cserve_v2_put_serialize( + self, + deployment_id, + create_c_serve_v2_deployment_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if deployment_id is not None: + + _query_params.append(('deployment_id', deployment_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_c_serve_v2_deployment_request is not None: + _body_params = create_c_serve_v2_deployment_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/deployments/cserve_v2', + 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 update_deployment_status_deployments_status_deployment_id_put( self, deployment_id: StrictInt, - deployment_status_request: DeploymentStatusRequest, + deployment_status_request: DeploymentStatusRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> DeploymentStatusResponse: + """Update Deployment Status + + + :param deployment_id: (required) + :type deployment_id: int + :param deployment_status_request: (required) + :type deployment_status_request: DeploymentStatusRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_deployment_status_deployments_status_deployment_id_put_serialize( + deployment_id=deployment_id, + deployment_status_request=deployment_status_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeploymentStatusResponse", + '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 update_deployment_status_deployments_status_deployment_id_put_with_http_info( + self, + deployment_id: StrictInt, + deployment_status_request: DeploymentStatusRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[DeploymentStatusResponse]: + """Update Deployment Status + + + :param deployment_id: (required) + :type deployment_id: int + :param deployment_status_request: (required) + :type deployment_status_request: DeploymentStatusRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_deployment_status_deployments_status_deployment_id_put_serialize( + deployment_id=deployment_id, + deployment_status_request=deployment_status_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeploymentStatusResponse", + '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 update_deployment_status_deployments_status_deployment_id_put_without_preload_content( + self, + deployment_id: StrictInt, + deployment_status_request: DeploymentStatusRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update Deployment Status + + + :param deployment_id: (required) + :type deployment_id: int + :param deployment_status_request: (required) + :type deployment_status_request: DeploymentStatusRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_deployment_status_deployments_status_deployment_id_put_serialize( + deployment_id=deployment_id, + deployment_status_request=deployment_status_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "DeploymentStatusResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_deployment_status_deployments_status_deployment_id_put_serialize( + self, + deployment_id, + deployment_status_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if deployment_id is not None: + _path_params['deployment_id'] = deployment_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if deployment_status_request is not None: + _body_params = deployment_status_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/deployments/status/{deployment_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_inference_deployment_deployments_inference_put( + self, + deployment_id: StrictInt, + create_inference_deployment_request: CreateInferenceDeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateDeploymentResponse: + """Update Inference Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_inference_deployment_request: (required) + :type create_inference_deployment_request: CreateInferenceDeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_inference_deployment_deployments_inference_put_serialize( + deployment_id=deployment_id, + create_inference_deployment_request=create_inference_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '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 update_inference_deployment_deployments_inference_put_with_http_info( + self, + deployment_id: StrictInt, + create_inference_deployment_request: CreateInferenceDeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[UpdateDeploymentResponse]: + """Update Inference Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_inference_deployment_request: (required) + :type create_inference_deployment_request: CreateInferenceDeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_inference_deployment_deployments_inference_put_serialize( + deployment_id=deployment_id, + create_inference_deployment_request=create_inference_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", + '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 update_inference_deployment_deployments_inference_put_without_preload_content( + self, + deployment_id: StrictInt, + create_inference_deployment_request: CreateInferenceDeploymentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9780,14 +10794,14 @@ def update_deployment_status_deployments_status_deployment_id_put( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeploymentStatusResponse: - """Update Deployment Status + ) -> RESTResponseType: + """Update Inference Deployment :param deployment_id: (required) :type deployment_id: int - :param deployment_status_request: (required) - :type deployment_status_request: DeploymentStatusRequest + :param create_inference_deployment_request: (required) + :type create_inference_deployment_request: CreateInferenceDeploymentRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9810,9 +10824,9 @@ def update_deployment_status_deployments_status_deployment_id_put( :return: Returns the result object. """ # noqa: E501 - _param = self._update_deployment_status_deployments_status_deployment_id_put_serialize( + _param = self._update_inference_deployment_deployments_inference_put_serialize( deployment_id=deployment_id, - deployment_status_request=deployment_status_request, + create_inference_deployment_request=create_inference_deployment_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9820,7 +10834,156 @@ def update_deployment_status_deployments_status_deployment_id_put( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeploymentStatusResponse", + '200': "UpdateDeploymentResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_inference_deployment_deployments_inference_put_serialize( + self, + deployment_id, + create_inference_deployment_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if deployment_id is not None: + + _query_params.append(('deployment_id', deployment_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + if create_inference_deployment_request is not None: + _body_params = create_inference_deployment_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'HTTPBearer' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/deployments/inference', + 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 update_rag_deployment_deployments_rag_put( + self, + deployment_id: StrictInt, + create_rag_deployment_request: CreateRagDeploymentRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UpdateDeploymentResponse: + """Update Rag Deployment + + + :param deployment_id: (required) + :type deployment_id: int + :param create_rag_deployment_request: (required) + :type create_rag_deployment_request: CreateRagDeploymentRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + 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._update_rag_deployment_deployments_rag_put_serialize( + deployment_id=deployment_id, + create_rag_deployment_request=create_rag_deployment_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UpdateDeploymentResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -9835,10 +10998,10 @@ def update_deployment_status_deployments_status_deployment_id_put( @validate_call - def update_deployment_status_deployments_status_deployment_id_put_with_http_info( + def update_rag_deployment_deployments_rag_put_with_http_info( self, deployment_id: StrictInt, - deployment_status_request: DeploymentStatusRequest, + create_rag_deployment_request: CreateRagDeploymentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9851,14 +11014,14 @@ def update_deployment_status_deployments_status_deployment_id_put_with_http_info _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DeploymentStatusResponse]: - """Update Deployment Status + ) -> ApiResponse[UpdateDeploymentResponse]: + """Update Rag Deployment :param deployment_id: (required) :type deployment_id: int - :param deployment_status_request: (required) - :type deployment_status_request: DeploymentStatusRequest + :param create_rag_deployment_request: (required) + :type create_rag_deployment_request: CreateRagDeploymentRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9881,9 +11044,9 @@ def update_deployment_status_deployments_status_deployment_id_put_with_http_info :return: Returns the result object. """ # noqa: E501 - _param = self._update_deployment_status_deployments_status_deployment_id_put_serialize( + _param = self._update_rag_deployment_deployments_rag_put_serialize( deployment_id=deployment_id, - deployment_status_request=deployment_status_request, + create_rag_deployment_request=create_rag_deployment_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9891,7 +11054,7 @@ def update_deployment_status_deployments_status_deployment_id_put_with_http_info ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeploymentStatusResponse", + '200': "UpdateDeploymentResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -9906,10 +11069,10 @@ def update_deployment_status_deployments_status_deployment_id_put_with_http_info @validate_call - def update_deployment_status_deployments_status_deployment_id_put_without_preload_content( + def update_rag_deployment_deployments_rag_put_without_preload_content( self, deployment_id: StrictInt, - deployment_status_request: DeploymentStatusRequest, + create_rag_deployment_request: CreateRagDeploymentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -9923,13 +11086,13 @@ def update_deployment_status_deployments_status_deployment_id_put_without_preloa _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Deployment Status + """Update Rag Deployment :param deployment_id: (required) :type deployment_id: int - :param deployment_status_request: (required) - :type deployment_status_request: DeploymentStatusRequest + :param create_rag_deployment_request: (required) + :type create_rag_deployment_request: CreateRagDeploymentRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9952,9 +11115,9 @@ def update_deployment_status_deployments_status_deployment_id_put_without_preloa :return: Returns the result object. """ # noqa: E501 - _param = self._update_deployment_status_deployments_status_deployment_id_put_serialize( + _param = self._update_rag_deployment_deployments_rag_put_serialize( deployment_id=deployment_id, - deployment_status_request=deployment_status_request, + create_rag_deployment_request=create_rag_deployment_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9962,7 +11125,7 @@ def update_deployment_status_deployments_status_deployment_id_put_without_preloa ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeploymentStatusResponse", + '200': "UpdateDeploymentResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -9972,10 +11135,10 @@ def update_deployment_status_deployments_status_deployment_id_put_without_preloa return response_data.response - def _update_deployment_status_deployments_status_deployment_id_put_serialize( + def _update_rag_deployment_deployments_rag_put_serialize( self, deployment_id, - deployment_status_request, + create_rag_deployment_request, _request_auth, _content_type, _headers, @@ -9997,14 +11160,16 @@ def _update_deployment_status_deployments_status_deployment_id_put_serialize( _body_params: Optional[bytes] = None # process the path parameters - if deployment_id is not None: - _path_params['deployment_id'] = deployment_id # process the query parameters + if deployment_id is not None: + + _query_params.append(('deployment_id', deployment_id)) + # process the header parameters # process the form parameters # process the body parameter - if deployment_status_request is not None: - _body_params = deployment_status_request + if create_rag_deployment_request is not None: + _body_params = create_rag_deployment_request # set the HTTP header `Accept` @@ -10036,7 +11201,7 @@ def _update_deployment_status_deployments_status_deployment_id_put_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/deployments/status/{deployment_id}', + resource_path='/deployments/rag', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/platform_api_python_client/api_client.py b/platform_api_python_client/api_client.py index 6b3a70d..50c8c79 100644 --- a/platform_api_python_client/api_client.py +++ b/platform_api_python_client/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/3.2.5/python' + self.user_agent = 'OpenAPI-Generator/3.2.7/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/platform_api_python_client/configuration.py b/platform_api_python_client/configuration.py index a7a9ad4..2f3511a 100644 --- a/platform_api_python_client/configuration.py +++ b/platform_api_python_client/configuration.py @@ -392,7 +392,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.1.0\n"\ - "SDK Package Version: 3.2.5".\ + "SDK Package Version: 3.2.7".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/platform_api_python_client/models/__init__.py b/platform_api_python_client/models/__init__.py index 5fb539a..ed558c6 100644 --- a/platform_api_python_client/models/__init__.py +++ b/platform_api_python_client/models/__init__.py @@ -69,6 +69,7 @@ from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse from platform_api_python_client.models.service_status import ServiceStatus from platform_api_python_client.models.update_autocharge_preferences_request import UpdateAutochargePreferencesRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse from platform_api_python_client.models.user_support_email_request import UserSupportEmailRequest from platform_api_python_client.models.user_vault_item import UserVaultItem from platform_api_python_client.models.user_vault_type import UserVaultType diff --git a/platform_api_python_client/models/update_deployment_response.py b/platform_api_python_client/models/update_deployment_response.py new file mode 100644 index 0000000..c35bc01 --- /dev/null +++ b/platform_api_python_client/models/update_deployment_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Platform External API + + 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 pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class UpdateDeploymentResponse(BaseModel): + """ + UpdateDeploymentResponse + """ # noqa: E501 + id: StrictInt + endpoint_url: StrictStr + updated_at: datetime + __properties: ClassVar[List[str]] = ["id", "endpoint_url", "updated_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateDeploymentResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateDeploymentResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "endpoint_url": obj.get("endpoint_url"), + "updated_at": obj.get("updated_at") + }) + return _obj + + diff --git a/pyproject.toml b/pyproject.toml index cef8984..ccf66e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "platform_api_python_client" -version = "3.2.5" +version = "3.2.7" description = "Platform External API" authors = ["OpenAPI Generator Community "] license = "NoLicense" diff --git a/setup.py b/setup.py index 5889d82..289c064 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "platform-api-python-client" -VERSION = "3.2.5" +VERSION = "3.2.7" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0", diff --git a/test/test_external_api.py b/test/test_external_api.py index 571c9c6..c989a4d 100644 --- a/test/test_external_api.py +++ b/test/test_external_api.py @@ -96,6 +96,13 @@ def test_delete_api_key_credentials_api_key_id_delete(self) -> None: """ pass + def test_delete_autocharge_preferences_autocharge_preferences_delete(self) -> None: + """Test case for delete_autocharge_preferences_autocharge_preferences_delete + + Delete Autocharge Preferences + """ + pass + def test_delete_payment_method_payments_methods_delete(self) -> None: """Test case for delete_payment_method_payments_methods_delete @@ -271,6 +278,20 @@ def test_update_autocharge_preferences_autocharge_preferences_put(self) -> None: """ pass + def test_update_compute_deployment_deployments_compute_put(self) -> None: + """Test case for update_compute_deployment_deployments_compute_put + + Update Compute Deployment + """ + pass + + def test_update_cserve_v2_deployment_deployments_cserve_v2_put(self) -> None: + """Test case for update_cserve_v2_deployment_deployments_cserve_v2_put + + Update Cserve V2 Deployment + """ + pass + def test_update_deployment_status_deployments_status_deployment_id_put(self) -> None: """Test case for update_deployment_status_deployments_status_deployment_id_put @@ -278,6 +299,20 @@ def test_update_deployment_status_deployments_status_deployment_id_put(self) -> """ pass + def test_update_inference_deployment_deployments_inference_put(self) -> None: + """Test case for update_inference_deployment_deployments_inference_put + + Update Inference Deployment + """ + pass + + def test_update_rag_deployment_deployments_rag_put(self) -> None: + """Test case for update_rag_deployment_deployments_rag_put + + Update Rag Deployment + """ + pass + def test_update_user_vault_item_endpoint_user_vault_put(self) -> None: """Test case for update_user_vault_item_endpoint_user_vault_put diff --git a/test/test_update_deployment_response.py b/test/test_update_deployment_response.py new file mode 100644 index 0000000..18f5cd9 --- /dev/null +++ b/test/test_update_deployment_response.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Platform External API + + 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 platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse + +class TestUpdateDeploymentResponse(unittest.TestCase): + """UpdateDeploymentResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateDeploymentResponse: + """Test UpdateDeploymentResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateDeploymentResponse` + """ + model = UpdateDeploymentResponse() + if include_optional: + return UpdateDeploymentResponse( + id = 56, + endpoint_url = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') + ) + else: + return UpdateDeploymentResponse( + id = 56, + endpoint_url = '', + updated_at = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + ) + """ + + def testUpdateDeploymentResponse(self): + """Test UpdateDeploymentResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()