From 0418a06110235a33cc35d24d27282437138e6073 Mon Sep 17 00:00:00 2001 From: p-fruck Date: Mon, 22 Aug 2022 18:24:26 +0000 Subject: [PATCH] update to latest API spec --- .openapi-generator/FILES | 9 + README.md | 5 + docs/AssignVipResponse.md | 13 + docs/AssignVipResponseLinks.md | 12 + docs/UnassignVipResponse.md | 13 + docs/VIPApi.md | 186 ++++++++++ pfruck_contabo/api/vip_api.py | 336 ++++++++++++++++++ pfruck_contabo/model/assign_vip_response.py | 283 +++++++++++++++ .../model/assign_vip_response_links.py | 319 +++++++++++++++++ pfruck_contabo/model/unassign_vip_response.py | 283 +++++++++++++++ pfruck_contabo/models/__init__.py | 3 + setup.py | 5 + test/test_assign_vip_response.py | 39 ++ test/test_assign_vip_response_links.py | 37 ++ test/test_unassign_vip_response.py | 39 ++ 15 files changed, 1582 insertions(+) create mode 100644 docs/AssignVipResponse.md create mode 100644 docs/AssignVipResponseLinks.md create mode 100644 docs/UnassignVipResponse.md create mode 100644 pfruck_contabo/model/assign_vip_response.py create mode 100644 pfruck_contabo/model/assign_vip_response_links.py create mode 100644 pfruck_contabo/model/unassign_vip_response.py create mode 100644 test/test_assign_vip_response.py create mode 100644 test/test_assign_vip_response_links.py create mode 100644 test/test_unassign_vip_response.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index b4ad042..38bc9bb 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -9,6 +9,8 @@ docs/AssignInstanceFirewallResponse.md docs/AssignInstanceFirewallResponseLinks.md docs/AssignInstancePrivateNetworkResponse.md docs/AssignInstancePrivateNetworkResponseLinks.md +docs/AssignVipResponse.md +docs/AssignVipResponseLinks.md docs/AssignmentAuditResponse.md docs/AssignmentResponse.md docs/AutoScalingTypeRequest.md @@ -284,6 +286,7 @@ docs/TagsApi.md docs/TagsAuditsApi.md docs/UnassignInstanceFirewallResponse.md docs/UnassignInstancePrivateNetworkResponse.md +docs/UnassignVipResponse.md docs/UpdateCustomImageRequest.md docs/UpdateCustomImageResponse.md docs/UpdateCustomImageResponseData.md @@ -368,6 +371,8 @@ pfruck_contabo/model/assign_instance_firewall_response.py pfruck_contabo/model/assign_instance_firewall_response_links.py pfruck_contabo/model/assign_instance_private_network_response.py pfruck_contabo/model/assign_instance_private_network_response_links.py +pfruck_contabo/model/assign_vip_response.py +pfruck_contabo/model/assign_vip_response_links.py pfruck_contabo/model/assignment_audit_response.py pfruck_contabo/model/assignment_response.py pfruck_contabo/model/auto_scaling_type_request.py @@ -615,6 +620,7 @@ pfruck_contabo/model/tag_response.py pfruck_contabo/model/tag_response1.py pfruck_contabo/model/unassign_instance_firewall_response.py pfruck_contabo/model/unassign_instance_private_network_response.py +pfruck_contabo/model/unassign_vip_response.py pfruck_contabo/model/update_custom_image_request.py pfruck_contabo/model/update_custom_image_response.py pfruck_contabo/model/update_custom_image_response_data.py @@ -657,4 +663,7 @@ setup.cfg setup.py test-requirements.txt test/__init__.py +test/test_assign_vip_response.py +test/test_assign_vip_response_links.py +test/test_unassign_vip_response.py tox.ini diff --git a/README.md b/README.md index 00ac029..6b94e44 100644 --- a/README.md +++ b/README.md @@ -192,8 +192,10 @@ Class | Method | HTTP request | Description *UsersApi* | [**retrieve_user_list**](docs/UsersApi.md#retrieve_user_list) | **GET** /v1/users | List users *UsersApi* | [**update_user**](docs/UsersApi.md#update_user) | **PATCH** /v1/users/{userId} | Update specific user by id *UsersAuditsApi* | [**retrieve_user_audits_list**](docs/UsersAuditsApi.md#retrieve_user_audits_list) | **GET** /v1/users/audits | List history about your users (audit) +*VIPApi* | [**assign_ip**](docs/VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/instances/{instanceId} | Assign a VIP to a VPS/VDS *VIPApi* | [**retrieve_vip**](docs/VIPApi.md#retrieve_vip) | **GET** /v1/vips/{ip} | Get specific VIP by ip *VIPApi* | [**retrieve_vip_list**](docs/VIPApi.md#retrieve_vip_list) | **GET** /v1/vips | List VIPs +*VIPApi* | [**unassign_ip**](docs/VIPApi.md#unassign_ip) | **DELETE** /v1/vips/{ip}/instances/{instanceId} | Unassign a VIP from a VPS/VDS *ZeropsApi* | [**retrieve_zerops_user**](docs/ZeropsApi.md#retrieve_zerops_user) | **GET** /v1/zerops/user | get zerops user *ZeropsApi* | [**sign_in_zerops**](docs/ZeropsApi.md#sign_in_zerops) | **GET** /v1/zerops/sign-in | authenticate to zerops @@ -207,6 +209,8 @@ Class | Method | HTTP request | Description - [AssignInstanceFirewallResponseLinks](docs/AssignInstanceFirewallResponseLinks.md) - [AssignInstancePrivateNetworkResponse](docs/AssignInstancePrivateNetworkResponse.md) - [AssignInstancePrivateNetworkResponseLinks](docs/AssignInstancePrivateNetworkResponseLinks.md) + - [AssignVipResponse](docs/AssignVipResponse.md) + - [AssignVipResponseLinks](docs/AssignVipResponseLinks.md) - [AssignmentAuditResponse](docs/AssignmentAuditResponse.md) - [AssignmentResponse](docs/AssignmentResponse.md) - [AutoScalingTypeRequest](docs/AutoScalingTypeRequest.md) @@ -454,6 +458,7 @@ Class | Method | HTTP request | Description - [TagResponse1](docs/TagResponse1.md) - [UnassignInstanceFirewallResponse](docs/UnassignInstanceFirewallResponse.md) - [UnassignInstancePrivateNetworkResponse](docs/UnassignInstancePrivateNetworkResponse.md) + - [UnassignVipResponse](docs/UnassignVipResponse.md) - [UpdateCustomImageRequest](docs/UpdateCustomImageRequest.md) - [UpdateCustomImageResponse](docs/UpdateCustomImageResponse.md) - [UpdateCustomImageResponseData](docs/UpdateCustomImageResponseData.md) diff --git a/docs/AssignVipResponse.md b/docs/AssignVipResponse.md new file mode 100644 index 0000000..b37126a --- /dev/null +++ b/docs/AssignVipResponse.md @@ -0,0 +1,13 @@ +# AssignVipResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[VipResponse]**](VipResponse.md) | | +**links** | [**AssignVipResponseLinks**](AssignVipResponseLinks.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AssignVipResponseLinks.md b/docs/AssignVipResponseLinks.md new file mode 100644 index 0000000..dd7cb5c --- /dev/null +++ b/docs/AssignVipResponseLinks.md @@ -0,0 +1,12 @@ +# AssignVipResponseLinks + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_self** | **str** | Link to current resource. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnassignVipResponse.md b/docs/UnassignVipResponse.md new file mode 100644 index 0000000..0604fc5 --- /dev/null +++ b/docs/UnassignVipResponse.md @@ -0,0 +1,13 @@ +# UnassignVipResponse + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**[VipResponse]**](VipResponse.md) | | +**links** | [**AssignVipResponseLinks**](AssignVipResponseLinks.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VIPApi.md b/docs/VIPApi.md index 002c44b..3ea1eb7 100644 --- a/docs/VIPApi.md +++ b/docs/VIPApi.md @@ -4,10 +4,104 @@ All URIs are relative to *https://api.contabo.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**assign_ip**](VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/instances/{instanceId} | Assign a VIP to a VPS/VDS [**retrieve_vip**](VIPApi.md#retrieve_vip) | **GET** /v1/vips/{ip} | Get specific VIP by ip [**retrieve_vip_list**](VIPApi.md#retrieve_vip_list) | **GET** /v1/vips | List VIPs +[**unassign_ip**](VIPApi.md#unassign_ip) | **DELETE** /v1/vips/{ip}/instances/{instanceId} | Unassign a VIP from a VPS/VDS +# **assign_ip** +> AssignVipResponse assign_ip(x_request_id, instance_id, ip) + +Assign a VIP to a VPS/VDS + +Assign a VIP to a VPS/VDS using the machine id. + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import time +import pfruck_contabo +from pfruck_contabo.api import vip_api +from pfruck_contabo.model.assign_vip_response import AssignVipResponse +from pprint import pprint +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# 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 (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = vip_api.VIPApi(api_client) + x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + instance_id = 12345 # int | The identifier of the instance + ip = "127.0.0.1" # str | The ip you want to add the instance to + x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + + # example passing only required values which don't have defaults set + try: + # Assign a VIP to a VPS/VDS + api_response = api_instance.assign_ip(x_request_id, instance_id, ip) + pprint(api_response) + except pfruck_contabo.ApiException as e: + print("Exception when calling VIPApi->assign_ip: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Assign a VIP to a VPS/VDS + api_response = api_instance.assign_ip(x_request_id, instance_id, ip, x_trace_id=x_trace_id) + pprint(api_response) + except pfruck_contabo.ApiException as e: + print("Exception when calling VIPApi->assign_ip: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **ip** | **str**| The ip you want to add the instance to | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + +### Return type + +[**AssignVipResponse**](AssignVipResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The response will be a JSON object and contains standard VIP attributes. | - | + +[[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) + # **retrieve_vip** > FindVipResponse retrieve_vip(x_request_id, ip) @@ -214,3 +308,95 @@ 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) +# **unassign_ip** +> UnassignVipResponse unassign_ip(x_request_id, instance_id, ip) + +Unassign a VIP from a VPS/VDS + +Unassign a VIP from a VPS/VDS using the machine id. + +### Example + +* Bearer (JWT) Authentication (bearer): + +```python +import time +import pfruck_contabo +from pfruck_contabo.api import vip_api +from pfruck_contabo.model.unassign_vip_response import UnassignVipResponse +from pprint import pprint +# Defining the host is optional and defaults to https://api.contabo.com +# See configuration.py for a list of all supported configuration parameters. +configuration = pfruck_contabo.Configuration( + host = "https://api.contabo.com" +) + +# 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 (JWT): bearer +configuration = pfruck_contabo.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) + +# Enter a context with an instance of the API client +with pfruck_contabo.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = vip_api.VIPApi(api_client) + x_request_id = "04e0f898-37b4-48bc-a794-1a57abe6aa31" # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + instance_id = 12345 # int | The identifier of the instance + ip = "127.0.0.1" # str | The ip you want to add the instance to + x_trace_id = "x-trace-id_example" # str | Identifier to trace group of requests. (optional) + + # example passing only required values which don't have defaults set + try: + # Unassign a VIP from a VPS/VDS + api_response = api_instance.unassign_ip(x_request_id, instance_id, ip) + pprint(api_response) + except pfruck_contabo.ApiException as e: + print("Exception when calling VIPApi->unassign_ip: %s\n" % e) + + # example passing only required values which don't have defaults set + # and optional values + try: + # Unassign a VIP from a VPS/VDS + api_response = api_instance.unassign_ip(x_request_id, instance_id, ip, x_trace_id=x_trace_id) + pprint(api_response) + except pfruck_contabo.ApiException as e: + print("Exception when calling VIPApi->unassign_ip: %s\n" % e) +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_request_id** | **str**| [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. | + **instance_id** | **int**| The identifier of the instance | + **ip** | **str**| The ip you want to add the instance to | + **x_trace_id** | **str**| Identifier to trace group of requests. | [optional] + +### Return type + +[**UnassignVipResponse**](UnassignVipResponse.md) + +### Authorization + +[bearer](../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | The response will be a JSON object and contains standard VIP attributes. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/pfruck_contabo/api/vip_api.py b/pfruck_contabo/api/vip_api.py index 2dae3b9..e4db2cc 100644 --- a/pfruck_contabo/api/vip_api.py +++ b/pfruck_contabo/api/vip_api.py @@ -21,8 +21,10 @@ none_type, validate_and_convert_types ) +from pfruck_contabo.model.assign_vip_response import AssignVipResponse from pfruck_contabo.model.find_vip_response import FindVipResponse from pfruck_contabo.model.list_vip_response import ListVipResponse +from pfruck_contabo.model.unassign_vip_response import UnassignVipResponse class VIPApi(object): @@ -36,6 +38,81 @@ def __init__(self, api_client=None): if api_client is None: api_client = ApiClient() self.api_client = api_client + self.assign_ip_endpoint = _Endpoint( + settings={ + 'response_type': (AssignVipResponse,), + 'auth': [ + 'bearer' + ], + 'endpoint_path': '/v1/vips/{ip}/instances/{instanceId}', + 'operation_id': 'assign_ip', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'x_request_id', + 'instance_id', + 'ip', + 'x_trace_id', + ], + 'required': [ + 'x_request_id', + 'instance_id', + 'ip', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'x_request_id', + ] + }, + root_map={ + 'validations': { + ('x_request_id',): { + + 'regex': { + 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 + }, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_request_id': + (str,), + 'instance_id': + (int,), + 'ip': + (str,), + 'x_trace_id': + (str,), + }, + 'attribute_map': { + 'x_request_id': 'x-request-id', + 'instance_id': 'instanceId', + 'ip': 'ip', + 'x_trace_id': 'x-trace-id', + }, + 'location_map': { + 'x_request_id': 'header', + 'instance_id': 'path', + 'ip': 'path', + 'x_trace_id': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) self.retrieve_vip_endpoint = _Endpoint( settings={ 'response_type': (FindVipResponse,), @@ -252,6 +329,173 @@ def __init__(self, api_client=None): }, api_client=api_client ) + self.unassign_ip_endpoint = _Endpoint( + settings={ + 'response_type': (UnassignVipResponse,), + 'auth': [ + 'bearer' + ], + 'endpoint_path': '/v1/vips/{ip}/instances/{instanceId}', + 'operation_id': 'unassign_ip', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'x_request_id', + 'instance_id', + 'ip', + 'x_trace_id', + ], + 'required': [ + 'x_request_id', + 'instance_id', + 'ip', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'x_request_id', + ] + }, + root_map={ + 'validations': { + ('x_request_id',): { + + 'regex': { + 'pattern': r'^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-5][0-9A-Fa-f]{3}-[089abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$', # noqa: E501 + }, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_request_id': + (str,), + 'instance_id': + (int,), + 'ip': + (str,), + 'x_trace_id': + (str,), + }, + 'attribute_map': { + 'x_request_id': 'x-request-id', + 'instance_id': 'instanceId', + 'ip': 'ip', + 'x_trace_id': 'x-trace-id', + }, + 'location_map': { + 'x_request_id': 'header', + 'instance_id': 'path', + 'ip': 'path', + 'x_trace_id': 'header', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def assign_ip( + self, + x_request_id, + instance_id, + ip, + **kwargs + ): + """Assign a VIP to a VPS/VDS # noqa: E501 + + Assign a VIP to a VPS/VDS using the machine id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.assign_ip(x_request_id, instance_id, ip, async_req=True) + >>> result = thread.get() + + Args: + x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + instance_id (int): The identifier of the instance + ip (str): The ip you want to add the instance to + + Keyword Args: + x_trace_id (str): Identifier to trace group of requests.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + AssignVipResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['x_request_id'] = \ + x_request_id + kwargs['instance_id'] = \ + instance_id + kwargs['ip'] = \ + ip + return self.assign_ip_endpoint.call_with_http_info(**kwargs) def retrieve_vip( self, @@ -438,3 +682,95 @@ def retrieve_vip_list( x_request_id return self.retrieve_vip_list_endpoint.call_with_http_info(**kwargs) + def unassign_ip( + self, + x_request_id, + instance_id, + ip, + **kwargs + ): + """Unassign a VIP from a VPS/VDS # noqa: E501 + + Unassign a VIP from a VPS/VDS using the machine id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.unassign_ip(x_request_id, instance_id, ip, async_req=True) + >>> result = thread.get() + + Args: + x_request_id (str): [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually. + instance_id (int): The identifier of the instance + ip (str): The ip you want to add the instance to + + Keyword Args: + x_trace_id (str): Identifier to trace group of requests.. [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + _request_auths (list): set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + Default is None + async_req (bool): execute request asynchronously + + Returns: + UnassignVipResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['_request_auths'] = kwargs.get('_request_auths', None) + kwargs['x_request_id'] = \ + x_request_id + kwargs['instance_id'] = \ + instance_id + kwargs['ip'] = \ + ip + return self.unassign_ip_endpoint.call_with_http_info(**kwargs) + diff --git a/pfruck_contabo/model/assign_vip_response.py b/pfruck_contabo/model/assign_vip_response.py new file mode 100644 index 0000000..cc37f88 --- /dev/null +++ b/pfruck_contabo/model/assign_vip_response.py @@ -0,0 +1,283 @@ +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from pfruck_contabo.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from pfruck_contabo.exceptions import ApiAttributeError + + +def lazy_import(): + from pfruck_contabo.model.assign_vip_response_links import AssignVipResponseLinks + from pfruck_contabo.model.vip_response import VipResponse + globals()['AssignVipResponseLinks'] = AssignVipResponseLinks + globals()['VipResponse'] = VipResponse + + +class AssignVipResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([VipResponse],), # noqa: E501 + 'links': (AssignVipResponseLinks,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'links': '_links', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, links, *args, **kwargs): # noqa: E501 + """AssignVipResponse - a model defined in OpenAPI + + Args: + data ([VipResponse]): + links (AssignVipResponseLinks): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.links = links + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, data, links, *args, **kwargs): # noqa: E501 + """AssignVipResponse - a model defined in OpenAPI + + Args: + data ([VipResponse]): + links (AssignVipResponseLinks): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.links = links + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pfruck_contabo/model/assign_vip_response_links.py b/pfruck_contabo/model/assign_vip_response_links.py new file mode 100644 index 0000000..8ce30c3 --- /dev/null +++ b/pfruck_contabo/model/assign_vip_response_links.py @@ -0,0 +1,319 @@ +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from pfruck_contabo.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from pfruck_contabo.exceptions import ApiAttributeError + + +def lazy_import(): + from pfruck_contabo.model.self_links import SelfLinks + globals()['SelfLinks'] = SelfLinks + + +class AssignVipResponseLinks(ModelComposed): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + '_self': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + '_self': 'self', # noqa: E501 + } + + read_only_vars = { + } + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AssignVipResponseLinks - a model defined in OpenAPI + + Keyword Args: + _self (str): Link to current resource. + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + '_composed_instances', + '_var_name_to_model_instances', + '_additional_properties_model_instances', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """AssignVipResponseLinks - a model defined in OpenAPI + + Keyword Args: + _self (str): Link to current resource. + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + '_check_type': _check_type, + '_path_to_item': _path_to_item, + '_spec_property_naming': _spec_property_naming, + '_configuration': _configuration, + '_visited_composed_classes': self._visited_composed_classes, + } + composed_info = validate_get_composed_info( + constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if var_name in discarded_args and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self._additional_properties_model_instances: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") + + @cached_property + def _composed_schemas(): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + 'anyOf': [ + ], + 'allOf': [ + SelfLinks, + ], + 'oneOf': [ + ], + } diff --git a/pfruck_contabo/model/unassign_vip_response.py b/pfruck_contabo/model/unassign_vip_response.py new file mode 100644 index 0000000..25487f0 --- /dev/null +++ b/pfruck_contabo/model/unassign_vip_response.py @@ -0,0 +1,283 @@ +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from pfruck_contabo.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from pfruck_contabo.exceptions import ApiAttributeError + + +def lazy_import(): + from pfruck_contabo.model.assign_vip_response_links import AssignVipResponseLinks + from pfruck_contabo.model.vip_response import VipResponse + globals()['AssignVipResponseLinks'] = AssignVipResponseLinks + globals()['VipResponse'] = VipResponse + + +class UnassignVipResponse(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + 'data': ([VipResponse],), # noqa: E501 + 'links': (AssignVipResponseLinks,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'links': '_links', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, links, *args, **kwargs): # noqa: E501 + """UnassignVipResponse - a model defined in OpenAPI + + Args: + data ([VipResponse]): + links (AssignVipResponseLinks): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', True) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.links = links + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, data, links, *args, **kwargs): # noqa: E501 + """UnassignVipResponse - a model defined in OpenAPI + + Args: + data ([VipResponse]): + links (AssignVipResponseLinks): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + for arg in args: + if isinstance(arg, dict): + kwargs.update(arg) + else: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + self.links = links + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pfruck_contabo/models/__init__.py b/pfruck_contabo/models/__init__.py index 07e5dab..2b7dd74 100644 --- a/pfruck_contabo/models/__init__.py +++ b/pfruck_contabo/models/__init__.py @@ -16,6 +16,8 @@ from pfruck_contabo.model.assign_instance_firewall_response_links import AssignInstanceFirewallResponseLinks from pfruck_contabo.model.assign_instance_private_network_response import AssignInstancePrivateNetworkResponse from pfruck_contabo.model.assign_instance_private_network_response_links import AssignInstancePrivateNetworkResponseLinks +from pfruck_contabo.model.assign_vip_response import AssignVipResponse +from pfruck_contabo.model.assign_vip_response_links import AssignVipResponseLinks from pfruck_contabo.model.assignment_audit_response import AssignmentAuditResponse from pfruck_contabo.model.assignment_response import AssignmentResponse from pfruck_contabo.model.auto_scaling_type_request import AutoScalingTypeRequest @@ -263,6 +265,7 @@ from pfruck_contabo.model.tag_response1 import TagResponse1 from pfruck_contabo.model.unassign_instance_firewall_response import UnassignInstanceFirewallResponse from pfruck_contabo.model.unassign_instance_private_network_response import UnassignInstancePrivateNetworkResponse +from pfruck_contabo.model.unassign_vip_response import UnassignVipResponse from pfruck_contabo.model.update_custom_image_request import UpdateCustomImageRequest from pfruck_contabo.model.update_custom_image_response import UpdateCustomImageResponse from pfruck_contabo.model.update_custom_image_response_data import UpdateCustomImageResponseData diff --git a/setup.py b/setup.py index 9ec1588..d187cf6 100644 --- a/setup.py +++ b/setup.py @@ -231,8 +231,10 @@ *UsersApi* | [**retrieve_user_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/UsersApi.md#retrieve_user_list) | **GET** /v1/users | List users *UsersApi* | [**update_user**](https://github.com/p-fruck/python-contabo/blob/main/docs/UsersApi.md#update_user) | **PATCH** /v1/users/{userId} | Update specific user by id *UsersAuditsApi* | [**retrieve_user_audits_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/UsersAuditsApi.md#retrieve_user_audits_list) | **GET** /v1/users/audits | List history about your users (audit) +*VIPApi* | [**assign_ip**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#assign_ip) | **POST** /v1/vips/{ip}/instances/{instanceId} | Assign a VIP to a VPS/VDS *VIPApi* | [**retrieve_vip**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#retrieve_vip) | **GET** /v1/vips/{ip} | Get specific VIP by ip *VIPApi* | [**retrieve_vip_list**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#retrieve_vip_list) | **GET** /v1/vips | List VIPs +*VIPApi* | [**unassign_ip**](https://github.com/p-fruck/python-contabo/blob/main/docs/VIPApi.md#unassign_ip) | **DELETE** /v1/vips/{ip}/instances/{instanceId} | Unassign a VIP from a VPS/VDS *ZeropsApi* | [**retrieve_zerops_user**](https://github.com/p-fruck/python-contabo/blob/main/docs/ZeropsApi.md#retrieve_zerops_user) | **GET** /v1/zerops/user | get zerops user *ZeropsApi* | [**sign_in_zerops**](https://github.com/p-fruck/python-contabo/blob/main/docs/ZeropsApi.md#sign_in_zerops) | **GET** /v1/zerops/sign-in | authenticate to zerops @@ -246,6 +248,8 @@ - [AssignInstanceFirewallResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignInstanceFirewallResponseLinks.md) - [AssignInstancePrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignInstancePrivateNetworkResponse.md) - [AssignInstancePrivateNetworkResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignInstancePrivateNetworkResponseLinks.md) + - [AssignVipResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignVipResponse.md) + - [AssignVipResponseLinks](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignVipResponseLinks.md) - [AssignmentAuditResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignmentAuditResponse.md) - [AssignmentResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/AssignmentResponse.md) - [AutoScalingTypeRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/AutoScalingTypeRequest.md) @@ -493,6 +497,7 @@ - [TagResponse1](https://github.com/p-fruck/python-contabo/blob/main/docs/TagResponse1.md) - [UnassignInstanceFirewallResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UnassignInstanceFirewallResponse.md) - [UnassignInstancePrivateNetworkResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UnassignInstancePrivateNetworkResponse.md) + - [UnassignVipResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UnassignVipResponse.md) - [UpdateCustomImageRequest](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateCustomImageRequest.md) - [UpdateCustomImageResponse](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateCustomImageResponse.md) - [UpdateCustomImageResponseData](https://github.com/p-fruck/python-contabo/blob/main/docs/UpdateCustomImageResponseData.md) diff --git a/test/test_assign_vip_response.py b/test/test_assign_vip_response.py new file mode 100644 index 0000000..0f07f96 --- /dev/null +++ b/test/test_assign_vip_response.py @@ -0,0 +1,39 @@ +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import pfruck_contabo +from pfruck_contabo.model.assign_vip_response_links import AssignVipResponseLinks +from pfruck_contabo.model.vip_response import VipResponse +globals()['AssignVipResponseLinks'] = AssignVipResponseLinks +globals()['VipResponse'] = VipResponse +from pfruck_contabo.model.assign_vip_response import AssignVipResponse + + +class TestAssignVipResponse(unittest.TestCase): + """AssignVipResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAssignVipResponse(self): + """Test AssignVipResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = AssignVipResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_assign_vip_response_links.py b/test/test_assign_vip_response_links.py new file mode 100644 index 0000000..365b7fd --- /dev/null +++ b/test/test_assign_vip_response_links.py @@ -0,0 +1,37 @@ +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import pfruck_contabo +from pfruck_contabo.model.self_links import SelfLinks +globals()['SelfLinks'] = SelfLinks +from pfruck_contabo.model.assign_vip_response_links import AssignVipResponseLinks + + +class TestAssignVipResponseLinks(unittest.TestCase): + """AssignVipResponseLinks unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAssignVipResponseLinks(self): + """Test AssignVipResponseLinks""" + # FIXME: construct object with mandatory attributes with example values + # model = AssignVipResponseLinks() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_unassign_vip_response.py b/test/test_unassign_vip_response.py new file mode 100644 index 0000000..74cdb7c --- /dev/null +++ b/test/test_unassign_vip_response.py @@ -0,0 +1,39 @@ +""" + Contabo API + + + The version of the OpenAPI document: 1.0.0 + Contact: support@contabo.com + Generated by: https://openapi-generator.tech +""" + + +import sys +import unittest + +import pfruck_contabo +from pfruck_contabo.model.assign_vip_response_links import AssignVipResponseLinks +from pfruck_contabo.model.vip_response import VipResponse +globals()['AssignVipResponseLinks'] = AssignVipResponseLinks +globals()['VipResponse'] = VipResponse +from pfruck_contabo.model.unassign_vip_response import UnassignVipResponse + + +class TestUnassignVipResponse(unittest.TestCase): + """UnassignVipResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testUnassignVipResponse(self): + """Test UnassignVipResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = UnassignVipResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()