diff --git a/README.md b/README.md index 8ecfc6c..4dacd94 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.1.6 +- Package version: 3.1.8 - Generator version: 7.9.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -102,6 +102,7 @@ Class | Method | HTTP request | Description *EXTERNALApi* | [**create_cserve_v2_deployment_deployments_cserve_v2_post**](docs/EXTERNALApi.md#create_cserve_v2_deployment_deployments_cserve_v2_post) | **POST** /deployments/cserve_v2 | Create Cserve V2 Deployment *EXTERNALApi* | [**create_inference_deployment_deployments_inference_post**](docs/EXTERNALApi.md#create_inference_deployment_deployments_inference_post) | **POST** /deployments/inference | Create Inference Deployment *EXTERNALApi* | [**create_rag_deployment_deployments_rag_post**](docs/EXTERNALApi.md#create_rag_deployment_deployments_rag_post) | **POST** /deployments/rag | Create Rag Deployment +*EXTERNALApi* | [**create_setup_payments_setup_checkout_post**](docs/EXTERNALApi.md#create_setup_payments_setup_checkout_post) | **POST** /payments/setup_checkout | Create Setup *EXTERNALApi* | [**delete_api_key_credentials_api_key_id_delete**](docs/EXTERNALApi.md#delete_api_key_credentials_api_key_id_delete) | **DELETE** /credentials/api-key/{id} | Delete Api Key *EXTERNALApi* | [**delete_user_vault_item_endpoint_user_vault_delete**](docs/EXTERNALApi.md#delete_user_vault_item_endpoint_user_vault_delete) | **DELETE** /user_vault | Delete User Vault Item Endpoint *EXTERNALApi* | [**get_all_user_vault_items_endpoint_user_vault_get**](docs/EXTERNALApi.md#get_all_user_vault_items_endpoint_user_vault_get) | **GET** /user_vault | Get All User Vault Items Endpoint @@ -141,13 +142,14 @@ Class | Method | HTTP request | Description - [CreateCServeV2DeploymentRequest](docs/CreateCServeV2DeploymentRequest.md) - [CreateCServeV2DeploymentResponse](docs/CreateCServeV2DeploymentResponse.md) - [CreateCheckoutRequest](docs/CreateCheckoutRequest.md) - - [CreateCheckoutResponse](docs/CreateCheckoutResponse.md) + - [CreateCheckoutSessionResponse](docs/CreateCheckoutSessionResponse.md) - [CreateComputeDeploymentRequest](docs/CreateComputeDeploymentRequest.md) - [CreateComputeDeploymentResponse](docs/CreateComputeDeploymentResponse.md) - [CreateInferenceDeploymentRequest](docs/CreateInferenceDeploymentRequest.md) - [CreateInferenceDeploymentResponse](docs/CreateInferenceDeploymentResponse.md) - [CreateRagDeploymentRequest](docs/CreateRagDeploymentRequest.md) - [CreateRagDeploymentResponse](docs/CreateRagDeploymentResponse.md) + - [CreateSetupCheckoutRequest](docs/CreateSetupCheckoutRequest.md) - [CreditsResponse](docs/CreditsResponse.md) - [DailyBillResponse](docs/DailyBillResponse.md) - [DeploymentStatus](docs/DeploymentStatus.md) diff --git a/docs/ClientSecretResponse.md b/docs/ClientSecretResponse.md new file mode 100644 index 0000000..5950168 --- /dev/null +++ b/docs/ClientSecretResponse.md @@ -0,0 +1,29 @@ +# ClientSecretResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_secret** | **str** | | + +## Example + +```python +from platform_api_python_client.models.client_secret_response import ClientSecretResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ClientSecretResponse from a JSON string +client_secret_response_instance = ClientSecretResponse.from_json(json) +# print the JSON string representation of the object +print(ClientSecretResponse.to_json()) + +# convert the object into a dict +client_secret_response_dict = client_secret_response_instance.to_dict() +# create an instance of ClientSecretResponse from a dict +client_secret_response_from_dict = ClientSecretResponse.from_dict(client_secret_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateCheckoutSessionResponse.md b/docs/CreateCheckoutSessionResponse.md new file mode 100644 index 0000000..0892854 --- /dev/null +++ b/docs/CreateCheckoutSessionResponse.md @@ -0,0 +1,29 @@ +# CreateCheckoutSessionResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **str** | | + +## Example + +```python +from platform_api_python_client.models.create_checkout_session_response import CreateCheckoutSessionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCheckoutSessionResponse from a JSON string +create_checkout_session_response_instance = CreateCheckoutSessionResponse.from_json(json) +# print the JSON string representation of the object +print(CreateCheckoutSessionResponse.to_json()) + +# convert the object into a dict +create_checkout_session_response_dict = create_checkout_session_response_instance.to_dict() +# create an instance of CreateCheckoutSessionResponse from a dict +create_checkout_session_response_from_dict = CreateCheckoutSessionResponse.from_dict(create_checkout_session_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateComputeDeploymentRequest.md b/docs/CreateComputeDeploymentRequest.md index 7abef60..9038a45 100644 --- a/docs/CreateComputeDeploymentRequest.md +++ b/docs/CreateComputeDeploymentRequest.md @@ -10,8 +10,7 @@ Name | Type | Description | Notes **hardware_instance_id** | **int** | | **image_url** | **str** | | **enable_jupyter** | **bool** | | [optional] [default to False] -**ssh_public_key** | **str** | | [optional] -**ssh_password** | **str** | | [optional] +**ssh_public_key** | **str** | | ## Example diff --git a/docs/CreateSetupCheckoutRequest.md b/docs/CreateSetupCheckoutRequest.md new file mode 100644 index 0000000..a00811e --- /dev/null +++ b/docs/CreateSetupCheckoutRequest.md @@ -0,0 +1,29 @@ +# CreateSetupCheckoutRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success_url** | **str** | | + +## Example + +```python +from platform_api_python_client.models.create_setup_checkout_request import CreateSetupCheckoutRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSetupCheckoutRequest from a JSON string +create_setup_checkout_request_instance = CreateSetupCheckoutRequest.from_json(json) +# print the JSON string representation of the object +print(CreateSetupCheckoutRequest.to_json()) + +# convert the object into a dict +create_setup_checkout_request_dict = create_setup_checkout_request_instance.to_dict() +# create an instance of CreateSetupCheckoutRequest from a dict +create_setup_checkout_request_from_dict = CreateSetupCheckoutRequest.from_dict(create_setup_checkout_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EXTERNALApi.md b/docs/EXTERNALApi.md index e1a6dc9..60c4a81 100644 --- a/docs/EXTERNALApi.md +++ b/docs/EXTERNALApi.md @@ -12,6 +12,7 @@ Method | HTTP request | Description [**create_cserve_v2_deployment_deployments_cserve_v2_post**](EXTERNALApi.md#create_cserve_v2_deployment_deployments_cserve_v2_post) | **POST** /deployments/cserve_v2 | Create Cserve V2 Deployment [**create_inference_deployment_deployments_inference_post**](EXTERNALApi.md#create_inference_deployment_deployments_inference_post) | **POST** /deployments/inference | Create Inference Deployment [**create_rag_deployment_deployments_rag_post**](EXTERNALApi.md#create_rag_deployment_deployments_rag_post) | **POST** /deployments/rag | Create Rag Deployment +[**create_setup_payments_setup_checkout_post**](EXTERNALApi.md#create_setup_payments_setup_checkout_post) | **POST** /payments/setup_checkout | Create Setup [**delete_api_key_credentials_api_key_id_delete**](EXTERNALApi.md#delete_api_key_credentials_api_key_id_delete) | **DELETE** /credentials/api-key/{id} | Delete Api Key [**delete_user_vault_item_endpoint_user_vault_delete**](EXTERNALApi.md#delete_user_vault_item_endpoint_user_vault_delete) | **DELETE** /user_vault | Delete User Vault Item Endpoint [**get_all_user_vault_items_endpoint_user_vault_get**](EXTERNALApi.md#get_all_user_vault_items_endpoint_user_vault_get) | **GET** /user_vault | Get All User Vault Items Endpoint @@ -193,7 +194,7 @@ 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) # **create_checkout_payments_checkout_post** -> CreateCheckoutResponse create_checkout_payments_checkout_post(create_checkout_request) +> CreateCheckoutSessionResponse create_checkout_payments_checkout_post(create_checkout_request) Create Checkout @@ -204,7 +205,7 @@ Create Checkout ```python import platform_api_python_client from platform_api_python_client.models.create_checkout_request import CreateCheckoutRequest -from platform_api_python_client.models.create_checkout_response import CreateCheckoutResponse +from platform_api_python_client.models.create_checkout_session_response import CreateCheckoutSessionResponse from platform_api_python_client.rest import ApiException from pprint import pprint @@ -250,7 +251,7 @@ Name | Type | Description | Notes ### Return type -[**CreateCheckoutResponse**](CreateCheckoutResponse.md) +[**CreateCheckoutSessionResponse**](CreateCheckoutSessionResponse.md) ### Authorization @@ -660,6 +661,84 @@ 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) +# **create_setup_payments_setup_checkout_post** +> CreateCheckoutSessionResponse create_setup_payments_setup_checkout_post(create_setup_checkout_request) + +Create Setup + +### Example + +* Bearer Authentication (HTTPBearer): + +```python +import platform_api_python_client +from platform_api_python_client.models.create_checkout_session_response import CreateCheckoutSessionResponse +from platform_api_python_client.models.create_setup_checkout_request import CreateSetupCheckoutRequest +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) + create_setup_checkout_request = platform_api_python_client.CreateSetupCheckoutRequest() # CreateSetupCheckoutRequest | + + try: + # Create Setup + api_response = api_instance.create_setup_payments_setup_checkout_post(create_setup_checkout_request) + print("The response of EXTERNALApi->create_setup_payments_setup_checkout_post:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EXTERNALApi->create_setup_payments_setup_checkout_post: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **create_setup_checkout_request** | [**CreateSetupCheckoutRequest**](CreateSetupCheckoutRequest.md)| | + +### Return type + +[**CreateCheckoutSessionResponse**](CreateCheckoutSessionResponse.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) + # **delete_api_key_credentials_api_key_id_delete** > object delete_api_key_credentials_api_key_id_delete(id) diff --git a/platform_api_python_client/__init__.py b/platform_api_python_client/__init__.py index db4014f..5d92ff9 100644 --- a/platform_api_python_client/__init__.py +++ b/platform_api_python_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "3.1.6" +__version__ = "3.1.8" # import apis into sdk package from platform_api_python_client.api.external_api import EXTERNALApi @@ -43,13 +43,14 @@ from platform_api_python_client.models.create_c_serve_v2_deployment_request import CreateCServeV2DeploymentRequest from platform_api_python_client.models.create_c_serve_v2_deployment_response import CreateCServeV2DeploymentResponse from platform_api_python_client.models.create_checkout_request import CreateCheckoutRequest -from platform_api_python_client.models.create_checkout_response import CreateCheckoutResponse +from platform_api_python_client.models.create_checkout_session_response import CreateCheckoutSessionResponse from platform_api_python_client.models.create_compute_deployment_request import CreateComputeDeploymentRequest from platform_api_python_client.models.create_compute_deployment_response import CreateComputeDeploymentResponse from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse from platform_api_python_client.models.create_rag_deployment_request import CreateRagDeploymentRequest from platform_api_python_client.models.create_rag_deployment_response import CreateRagDeploymentResponse +from platform_api_python_client.models.create_setup_checkout_request import CreateSetupCheckoutRequest from platform_api_python_client.models.credits_response import CreditsResponse from platform_api_python_client.models.daily_bill_response import DailyBillResponse from platform_api_python_client.models.deployment_status import DeploymentStatus diff --git a/platform_api_python_client/api/external_api.py b/platform_api_python_client/api/external_api.py index b4e6f6c..09fc424 100644 --- a/platform_api_python_client/api/external_api.py +++ b/platform_api_python_client/api/external_api.py @@ -26,13 +26,14 @@ from platform_api_python_client.models.create_c_serve_v2_deployment_request import CreateCServeV2DeploymentRequest from platform_api_python_client.models.create_c_serve_v2_deployment_response import CreateCServeV2DeploymentResponse from platform_api_python_client.models.create_checkout_request import CreateCheckoutRequest -from platform_api_python_client.models.create_checkout_response import CreateCheckoutResponse +from platform_api_python_client.models.create_checkout_session_response import CreateCheckoutSessionResponse from platform_api_python_client.models.create_compute_deployment_request import CreateComputeDeploymentRequest from platform_api_python_client.models.create_compute_deployment_response import CreateComputeDeploymentResponse from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse from platform_api_python_client.models.create_rag_deployment_request import CreateRagDeploymentRequest from platform_api_python_client.models.create_rag_deployment_response import CreateRagDeploymentResponse +from platform_api_python_client.models.create_setup_checkout_request import CreateSetupCheckoutRequest from platform_api_python_client.models.credits_response import CreditsResponse from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse @@ -640,7 +641,7 @@ def create_checkout_payments_checkout_post( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateCheckoutResponse: + ) -> CreateCheckoutSessionResponse: """Create Checkout @@ -677,7 +678,7 @@ def create_checkout_payments_checkout_post( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCheckoutResponse", + '200': "CreateCheckoutSessionResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -707,7 +708,7 @@ def create_checkout_payments_checkout_post_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[CreateCheckoutResponse]: + ) -> ApiResponse[CreateCheckoutSessionResponse]: """Create Checkout @@ -744,7 +745,7 @@ def create_checkout_payments_checkout_post_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCheckoutResponse", + '200': "CreateCheckoutSessionResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -811,7 +812,7 @@ def create_checkout_payments_checkout_post_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateCheckoutResponse", + '200': "CreateCheckoutSessionResponse", '422': "HTTPValidationError", } response_data = self.api_client.call_api( @@ -2268,6 +2269,280 @@ def _create_rag_deployment_deployments_rag_post_serialize( + @validate_call + def create_setup_payments_setup_checkout_post( + self, + create_setup_checkout_request: CreateSetupCheckoutRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateCheckoutSessionResponse: + """Create Setup + + + :param create_setup_checkout_request: (required) + :type create_setup_checkout_request: CreateSetupCheckoutRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_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._create_setup_payments_setup_checkout_post_serialize( + create_setup_checkout_request=create_setup_checkout_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateCheckoutSessionResponse", + '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 create_setup_payments_setup_checkout_post_with_http_info( + self, + create_setup_checkout_request: CreateSetupCheckoutRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[CreateCheckoutSessionResponse]: + """Create Setup + + + :param create_setup_checkout_request: (required) + :type create_setup_checkout_request: CreateSetupCheckoutRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_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._create_setup_payments_setup_checkout_post_serialize( + create_setup_checkout_request=create_setup_checkout_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateCheckoutSessionResponse", + '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 create_setup_payments_setup_checkout_post_without_preload_content( + self, + create_setup_checkout_request: CreateSetupCheckoutRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create Setup + + + :param create_setup_checkout_request: (required) + :type create_setup_checkout_request: CreateSetupCheckoutRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_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._create_setup_payments_setup_checkout_post_serialize( + create_setup_checkout_request=create_setup_checkout_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateCheckoutSessionResponse", + '422': "HTTPValidationError", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_setup_payments_setup_checkout_post_serialize( + self, + create_setup_checkout_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 + # process the header parameters + # process the form parameters + # process the body parameter + if create_setup_checkout_request is not None: + _body_params = create_setup_checkout_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='POST', + resource_path='/payments/setup_checkout', + 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 delete_api_key_credentials_api_key_id_delete( self, diff --git a/platform_api_python_client/api_client.py b/platform_api_python_client/api_client.py index abff685..acffa30 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.1.6/python' + self.user_agent = 'OpenAPI-Generator/3.1.8/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 729ec95..5509c5a 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.1.6".\ + "SDK Package Version: 3.1.8".\ 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 1345003..5e70566 100644 --- a/platform_api_python_client/models/__init__.py +++ b/platform_api_python_client/models/__init__.py @@ -26,13 +26,14 @@ from platform_api_python_client.models.create_c_serve_v2_deployment_request import CreateCServeV2DeploymentRequest from platform_api_python_client.models.create_c_serve_v2_deployment_response import CreateCServeV2DeploymentResponse from platform_api_python_client.models.create_checkout_request import CreateCheckoutRequest -from platform_api_python_client.models.create_checkout_response import CreateCheckoutResponse +from platform_api_python_client.models.create_checkout_session_response import CreateCheckoutSessionResponse from platform_api_python_client.models.create_compute_deployment_request import CreateComputeDeploymentRequest from platform_api_python_client.models.create_compute_deployment_response import CreateComputeDeploymentResponse from platform_api_python_client.models.create_inference_deployment_request import CreateInferenceDeploymentRequest from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse from platform_api_python_client.models.create_rag_deployment_request import CreateRagDeploymentRequest from platform_api_python_client.models.create_rag_deployment_response import CreateRagDeploymentResponse +from platform_api_python_client.models.create_setup_checkout_request import CreateSetupCheckoutRequest from platform_api_python_client.models.credits_response import CreditsResponse from platform_api_python_client.models.daily_bill_response import DailyBillResponse from platform_api_python_client.models.deployment_status import DeploymentStatus diff --git a/platform_api_python_client/models/client_secret_response.py b/platform_api_python_client/models/client_secret_response.py new file mode 100644 index 0000000..14874cf --- /dev/null +++ b/platform_api_python_client/models/client_secret_response.py @@ -0,0 +1,87 @@ +# 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 pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ClientSecretResponse(BaseModel): + """ + ClientSecretResponse + """ # noqa: E501 + client_secret: StrictStr + __properties: ClassVar[List[str]] = ["client_secret"] + + 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 ClientSecretResponse 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 ClientSecretResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "client_secret": obj.get("client_secret") + }) + return _obj + + diff --git a/platform_api_python_client/models/create_checkout_session_response.py b/platform_api_python_client/models/create_checkout_session_response.py new file mode 100644 index 0000000..6740f0a --- /dev/null +++ b/platform_api_python_client/models/create_checkout_session_response.py @@ -0,0 +1,87 @@ +# 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 pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateCheckoutSessionResponse(BaseModel): + """ + CreateCheckoutSessionResponse + """ # noqa: E501 + url: StrictStr + __properties: ClassVar[List[str]] = ["url"] + + 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 CreateCheckoutSessionResponse 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 CreateCheckoutSessionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url") + }) + return _obj + + diff --git a/platform_api_python_client/models/create_compute_deployment_request.py b/platform_api_python_client/models/create_compute_deployment_request.py index 8216f04..01153fa 100644 --- a/platform_api_python_client/models/create_compute_deployment_request.py +++ b/platform_api_python_client/models/create_compute_deployment_request.py @@ -32,9 +32,8 @@ class CreateComputeDeploymentRequest(BaseModel): hardware_instance_id: StrictInt image_url: StrictStr enable_jupyter: Optional[StrictBool] = False - ssh_public_key: Optional[StrictStr] = None - ssh_password: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "image_url", "enable_jupyter", "ssh_public_key", "ssh_password"] + ssh_public_key: StrictStr + __properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "image_url", "enable_jupyter", "ssh_public_key"] model_config = ConfigDict( populate_by_name=True, @@ -75,16 +74,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if ssh_public_key (nullable) is None - # and model_fields_set contains the field - if self.ssh_public_key is None and "ssh_public_key" in self.model_fields_set: - _dict['ssh_public_key'] = None - - # set to None if ssh_password (nullable) is None - # and model_fields_set contains the field - if self.ssh_password is None and "ssh_password" in self.model_fields_set: - _dict['ssh_password'] = None - return _dict @classmethod @@ -102,8 +91,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hardware_instance_id": obj.get("hardware_instance_id"), "image_url": obj.get("image_url"), "enable_jupyter": obj.get("enable_jupyter") if obj.get("enable_jupyter") is not None else False, - "ssh_public_key": obj.get("ssh_public_key"), - "ssh_password": obj.get("ssh_password") + "ssh_public_key": obj.get("ssh_public_key") }) return _obj diff --git a/platform_api_python_client/models/create_setup_checkout_request.py b/platform_api_python_client/models/create_setup_checkout_request.py new file mode 100644 index 0000000..8629a19 --- /dev/null +++ b/platform_api_python_client/models/create_setup_checkout_request.py @@ -0,0 +1,87 @@ +# 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 pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateSetupCheckoutRequest(BaseModel): + """ + CreateSetupCheckoutRequest + """ # noqa: E501 + success_url: StrictStr + __properties: ClassVar[List[str]] = ["success_url"] + + 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 CreateSetupCheckoutRequest 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 CreateSetupCheckoutRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "success_url": obj.get("success_url") + }) + return _obj + + diff --git a/pyproject.toml b/pyproject.toml index d84126a..22a30bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "platform_api_python_client" -version = "3.1.6" +version = "3.1.8" description = "Platform External API" authors = ["OpenAPI Generator Community "] license = "NoLicense" diff --git a/setup.py b/setup.py index ea1af9d..fc575de 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.1.6" +VERSION = "3.1.8" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0", diff --git a/test/test_client_secret_response.py b/test/test_client_secret_response.py new file mode 100644 index 0000000..6c5a545 --- /dev/null +++ b/test/test_client_secret_response.py @@ -0,0 +1,52 @@ +# 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.client_secret_response import ClientSecretResponse + +class TestClientSecretResponse(unittest.TestCase): + """ClientSecretResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ClientSecretResponse: + """Test ClientSecretResponse + 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 `ClientSecretResponse` + """ + model = ClientSecretResponse() + if include_optional: + return ClientSecretResponse( + client_secret = '' + ) + else: + return ClientSecretResponse( + client_secret = '', + ) + """ + + def testClientSecretResponse(self): + """Test ClientSecretResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_checkout_session_response.py b/test/test_create_checkout_session_response.py new file mode 100644 index 0000000..15d5a19 --- /dev/null +++ b/test/test_create_checkout_session_response.py @@ -0,0 +1,52 @@ +# 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.create_checkout_session_response import CreateCheckoutSessionResponse + +class TestCreateCheckoutSessionResponse(unittest.TestCase): + """CreateCheckoutSessionResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateCheckoutSessionResponse: + """Test CreateCheckoutSessionResponse + 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 `CreateCheckoutSessionResponse` + """ + model = CreateCheckoutSessionResponse() + if include_optional: + return CreateCheckoutSessionResponse( + url = '' + ) + else: + return CreateCheckoutSessionResponse( + url = '', + ) + """ + + def testCreateCheckoutSessionResponse(self): + """Test CreateCheckoutSessionResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_setup_checkout_request.py b/test/test_create_setup_checkout_request.py new file mode 100644 index 0000000..c57c8f0 --- /dev/null +++ b/test/test_create_setup_checkout_request.py @@ -0,0 +1,52 @@ +# 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.create_setup_checkout_request import CreateSetupCheckoutRequest + +class TestCreateSetupCheckoutRequest(unittest.TestCase): + """CreateSetupCheckoutRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSetupCheckoutRequest: + """Test CreateSetupCheckoutRequest + 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 `CreateSetupCheckoutRequest` + """ + model = CreateSetupCheckoutRequest() + if include_optional: + return CreateSetupCheckoutRequest( + success_url = '' + ) + else: + return CreateSetupCheckoutRequest( + success_url = '', + ) + """ + + def testCreateSetupCheckoutRequest(self): + """Test CreateSetupCheckoutRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()