diff --git a/services/ske/src/stackit/ske/__init__.py b/services/ske/src/stackit/ske/__init__.py index 2a0cd796..635e1e88 100644 --- a/services/ske/src/stackit/ske/__init__.py +++ b/services/ske/src/stackit/ske/__init__.py @@ -11,62 +11,123 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ACL", + "Argus", + "AvailabilityZone", + "CRI", + "Cluster", + "ClusterError", + "ClusterStatus", + "ClusterStatusState", + "CreateKubeconfigPayload", + "CreateOrUpdateClusterPayload", + "CredentialsRotationState", + "DNS", + "Extension", + "Hibernation", + "HibernationSchedule", + "Image", + "Kubeconfig", + "Kubernetes", + "KubernetesVersion", + "ListClustersResponse", + "LoginKubeconfig", + "Machine", + "MachineImage", + "MachineImageVersion", + "MachineType", + "Maintenance", + "MaintenanceAutoUpdate", + "Network", + "Nodepool", + "ProviderOptions", + "RuntimeError", + "Taint", + "TimeWindow", + "Volume", + "VolumeType", +] + # import apis into sdk package -from stackit.ske.api.default_api import DefaultApi -from stackit.ske.api_client import ApiClient +from stackit.ske.api.default_api import DefaultApi as DefaultApi +from stackit.ske.api_client import ApiClient as ApiClient # import ApiClient -from stackit.ske.api_response import ApiResponse -from stackit.ske.configuration import HostConfiguration -from stackit.ske.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.ske.api_response import ApiResponse as ApiResponse +from stackit.ske.configuration import HostConfiguration as HostConfiguration +from stackit.ske.exceptions import ApiAttributeError as ApiAttributeError +from stackit.ske.exceptions import ApiException as ApiException +from stackit.ske.exceptions import ApiKeyError as ApiKeyError +from stackit.ske.exceptions import ApiTypeError as ApiTypeError +from stackit.ske.exceptions import ApiValueError as ApiValueError +from stackit.ske.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.ske.models.acl import ACL -from stackit.ske.models.argus import Argus -from stackit.ske.models.availability_zone import AvailabilityZone -from stackit.ske.models.cluster import Cluster -from stackit.ske.models.cluster_error import ClusterError -from stackit.ske.models.cluster_status import ClusterStatus -from stackit.ske.models.cluster_status_state import ClusterStatusState -from stackit.ske.models.create_kubeconfig_payload import CreateKubeconfigPayload +from stackit.ske.models.acl import ACL as ACL +from stackit.ske.models.argus import Argus as Argus +from stackit.ske.models.availability_zone import AvailabilityZone as AvailabilityZone +from stackit.ske.models.cluster import Cluster as Cluster +from stackit.ske.models.cluster_error import ClusterError as ClusterError +from stackit.ske.models.cluster_status import ClusterStatus as ClusterStatus +from stackit.ske.models.cluster_status_state import ( + ClusterStatusState as ClusterStatusState, +) +from stackit.ske.models.create_kubeconfig_payload import ( + CreateKubeconfigPayload as CreateKubeconfigPayload, +) from stackit.ske.models.create_or_update_cluster_payload import ( - CreateOrUpdateClusterPayload, + CreateOrUpdateClusterPayload as CreateOrUpdateClusterPayload, +) +from stackit.ske.models.credentials_rotation_state import ( + CredentialsRotationState as CredentialsRotationState, +) +from stackit.ske.models.cri import CRI as CRI +from stackit.ske.models.dns import DNS as DNS +from stackit.ske.models.extension import Extension as Extension +from stackit.ske.models.hibernation import Hibernation as Hibernation +from stackit.ske.models.hibernation_schedule import ( + HibernationSchedule as HibernationSchedule, +) +from stackit.ske.models.image import Image as Image +from stackit.ske.models.kubeconfig import Kubeconfig as Kubeconfig +from stackit.ske.models.kubernetes import Kubernetes as Kubernetes +from stackit.ske.models.kubernetes_version import KubernetesVersion as KubernetesVersion +from stackit.ske.models.list_clusters_response import ( + ListClustersResponse as ListClustersResponse, +) +from stackit.ske.models.login_kubeconfig import LoginKubeconfig as LoginKubeconfig +from stackit.ske.models.machine import Machine as Machine +from stackit.ske.models.machine_image import MachineImage as MachineImage +from stackit.ske.models.machine_image_version import ( + MachineImageVersion as MachineImageVersion, +) +from stackit.ske.models.machine_type import MachineType as MachineType +from stackit.ske.models.maintenance import Maintenance as Maintenance +from stackit.ske.models.maintenance_auto_update import ( + MaintenanceAutoUpdate as MaintenanceAutoUpdate, ) -from stackit.ske.models.credentials_rotation_state import CredentialsRotationState -from stackit.ske.models.cri import CRI -from stackit.ske.models.dns import DNS -from stackit.ske.models.extension import Extension -from stackit.ske.models.hibernation import Hibernation -from stackit.ske.models.hibernation_schedule import HibernationSchedule -from stackit.ske.models.image import Image -from stackit.ske.models.kubeconfig import Kubeconfig -from stackit.ske.models.kubernetes import Kubernetes -from stackit.ske.models.kubernetes_version import KubernetesVersion -from stackit.ske.models.list_clusters_response import ListClustersResponse -from stackit.ske.models.login_kubeconfig import LoginKubeconfig -from stackit.ske.models.machine import Machine -from stackit.ske.models.machine_image import MachineImage -from stackit.ske.models.machine_image_version import MachineImageVersion -from stackit.ske.models.machine_type import MachineType -from stackit.ske.models.maintenance import Maintenance -from stackit.ske.models.maintenance_auto_update import MaintenanceAutoUpdate -from stackit.ske.models.network import Network -from stackit.ske.models.nodepool import Nodepool -from stackit.ske.models.provider_options import ProviderOptions -from stackit.ske.models.runtime_error import RuntimeError -from stackit.ske.models.taint import Taint -from stackit.ske.models.time_window import TimeWindow -from stackit.ske.models.volume import Volume -from stackit.ske.models.volume_type import VolumeType +from stackit.ske.models.network import Network as Network +from stackit.ske.models.nodepool import Nodepool as Nodepool +from stackit.ske.models.provider_options import ProviderOptions as ProviderOptions +from stackit.ske.models.runtime_error import RuntimeError as RuntimeError +from stackit.ske.models.taint import Taint as Taint +from stackit.ske.models.time_window import TimeWindow as TimeWindow +from stackit.ske.models.volume import Volume as Volume +from stackit.ske.models.volume_type import VolumeType as VolumeType diff --git a/services/ske/src/stackit/ske/api/default_api.py b/services/ske/src/stackit/ske/api/default_api.py index d9a364e0..a923afc2 100644 --- a/services/ske/src/stackit/ske/api/default_api.py +++ b/services/ske/src/stackit/ske/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -87,7 +87,7 @@ def complete_credentials_rotation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, @@ -154,7 +154,7 @@ def complete_credentials_rotation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, @@ -221,7 +221,7 @@ def complete_credentials_rotation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._complete_credentials_rotation_serialize( project_id=project_id, @@ -259,7 +259,7 @@ def _complete_credentials_rotation_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -340,7 +340,7 @@ def create_kubeconfig( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, @@ -408,7 +408,7 @@ def create_kubeconfig_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, @@ -476,7 +476,7 @@ def create_kubeconfig_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_kubeconfig_serialize( project_id=project_id, @@ -513,7 +513,7 @@ def _create_kubeconfig_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -604,7 +604,7 @@ def create_or_update_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, @@ -675,7 +675,7 @@ def create_or_update_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, @@ -746,7 +746,7 @@ def create_or_update_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._create_or_update_cluster_serialize( project_id=project_id, @@ -786,7 +786,7 @@ def _create_or_update_cluster_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -874,7 +874,7 @@ def delete_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, @@ -939,7 +939,7 @@ def delete_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, @@ -1004,7 +1004,7 @@ def delete_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._delete_cluster_serialize( project_id=project_id, @@ -1040,7 +1040,7 @@ def _delete_cluster_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1118,7 +1118,7 @@ def get_cluster( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, @@ -1182,7 +1182,7 @@ def get_cluster_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, @@ -1246,7 +1246,7 @@ def get_cluster_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_cluster_serialize( project_id=project_id, @@ -1281,7 +1281,7 @@ def _get_cluster_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1359,7 +1359,7 @@ def get_login_kubeconfig( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, @@ -1423,7 +1423,7 @@ def get_login_kubeconfig_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, @@ -1487,7 +1487,7 @@ def get_login_kubeconfig_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._get_login_kubeconfig_serialize( project_id=project_id, @@ -1522,7 +1522,7 @@ def _get_login_kubeconfig_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1597,7 +1597,7 @@ def list_clusters( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, @@ -1659,7 +1659,7 @@ def list_clusters_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, @@ -1721,7 +1721,7 @@ def list_clusters_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_clusters_serialize( project_id=project_id, @@ -1756,7 +1756,7 @@ def _list_clusters_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1826,7 +1826,7 @@ def list_provider_options( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -1879,7 +1879,7 @@ def list_provider_options_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -1932,7 +1932,7 @@ def list_provider_options_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_provider_options_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index @@ -1960,7 +1960,7 @@ def _list_provider_options_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2034,7 +2034,7 @@ def start_credentials_rotation( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, @@ -2101,7 +2101,7 @@ def start_credentials_rotation_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, @@ -2168,7 +2168,7 @@ def start_credentials_rotation_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._start_credentials_rotation_serialize( project_id=project_id, @@ -2206,7 +2206,7 @@ def _start_credentials_rotation_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2284,7 +2284,7 @@ def trigger_hibernate( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, @@ -2350,7 +2350,7 @@ def trigger_hibernate_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, @@ -2416,7 +2416,7 @@ def trigger_hibernate_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_hibernate_serialize( project_id=project_id, @@ -2453,7 +2453,7 @@ def _trigger_hibernate_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2531,7 +2531,7 @@ def trigger_maintenance( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, @@ -2597,7 +2597,7 @@ def trigger_maintenance_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, @@ -2663,7 +2663,7 @@ def trigger_maintenance_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_maintenance_serialize( project_id=project_id, @@ -2700,7 +2700,7 @@ def _trigger_maintenance_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2778,7 +2778,7 @@ def trigger_reconcile( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, @@ -2844,7 +2844,7 @@ def trigger_reconcile_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, @@ -2910,7 +2910,7 @@ def trigger_reconcile_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._trigger_reconcile_serialize( project_id=project_id, @@ -2947,7 +2947,7 @@ def _trigger_reconcile_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/ske/src/stackit/ske/api_client.py b/services/ske/src/stackit/ske/api_client.py index eb3998b1..39cb6277 100644 --- a/services/ske/src/stackit/ske/api_client.py +++ b/services/ske/src/stackit/ske/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/ske/src/stackit/ske/configuration.py b/services/ske/src/stackit/ske/configuration.py index 18f50ee3..ab95dc34 100644 --- a/services/ske/src/stackit/ske/configuration.py +++ b/services/ske/src/stackit/ske/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ SKE-API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -72,7 +89,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -112,7 +134,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -131,12 +153,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/ske/src/stackit/ske/exceptions.py b/services/ske/src/stackit/ske/exceptions.py index e302d148..784cb800 100644 --- a/services/ske/src/stackit/ske/exceptions.py +++ b/services/ske/src/stackit/ske/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -127,7 +127,7 @@ def __init__( if self.body is None: try: self.body = http_resp.data.decode("utf-8") - except Exception: # noqa: S110 + except Exception: pass self.headers = http_resp.getheaders() @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/ske/src/stackit/ske/models/__init__.py b/services/ske/src/stackit/ske/models/__init__.py index f4fa80bd..43e6acca 100644 --- a/services/ske/src/stackit/ske/models/__init__.py +++ b/services/ske/src/stackit/ske/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/ske/src/stackit/ske/models/acl.py b/services/ske/src/stackit/ske/models/acl.py index d9485a1f..f0050728 100644 --- a/services/ske/src/stackit/ske/models/acl.py +++ b/services/ske/src/stackit/ske/models/acl.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ACL(BaseModel): """ ACL - """ + """ # noqa: E501 allowed_cidrs: List[StrictStr] = Field( description="Array of CIDRs to allow access to the kubernetes API.", alias="allowedCidrs" diff --git a/services/ske/src/stackit/ske/models/argus.py b/services/ske/src/stackit/ske/models/argus.py index ed7cbb35..716adc3c 100644 --- a/services/ske/src/stackit/ske/models/argus.py +++ b/services/ske/src/stackit/ske/models/argus.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Argus(BaseModel): """ Argus - """ + """ # noqa: E501 argus_instance_id: StrictStr = Field( description="Argus instance ID to choose which Argus instance is used.", alias="argusInstanceId" diff --git a/services/ske/src/stackit/ske/models/availability_zone.py b/services/ske/src/stackit/ske/models/availability_zone.py index 707a09f7..4992eefa 100644 --- a/services/ske/src/stackit/ske/models/availability_zone.py +++ b/services/ske/src/stackit/ske/models/availability_zone.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class AvailabilityZone(BaseModel): """ AvailabilityZone - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/models/cluster.py b/services/ske/src/stackit/ske/models/cluster.py index 574dc127..67212cd9 100644 --- a/services/ske/src/stackit/ske/models/cluster.py +++ b/services/ske/src/stackit/ske/models/cluster.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class Cluster(BaseModel): """ Cluster - """ + """ # noqa: E501 extensions: Optional[Extension] = None hibernation: Optional[Hibernation] = None diff --git a/services/ske/src/stackit/ske/models/cluster_error.py b/services/ske/src/stackit/ske/models/cluster_error.py index 9a1c2da8..3a66bcfc 100644 --- a/services/ske/src/stackit/ske/models/cluster_error.py +++ b/services/ske/src/stackit/ske/models/cluster_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class ClusterError(BaseModel): """ ClusterError - """ + """ # noqa: E501 code: Optional[StrictStr] = None message: Optional[StrictStr] = None diff --git a/services/ske/src/stackit/ske/models/cluster_status.py b/services/ske/src/stackit/ske/models/cluster_status.py index 93b7aca6..3300e6b4 100644 --- a/services/ske/src/stackit/ske/models/cluster_status.py +++ b/services/ske/src/stackit/ske/models/cluster_status.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class ClusterStatus(BaseModel): """ ClusterStatus - """ + """ # noqa: E501 aggregated: Optional[ClusterStatusState] = ClusterStatusState.STATE_UNSPECIFIED creation_time: Optional[datetime] = Field( diff --git a/services/ske/src/stackit/ske/models/cluster_status_state.py b/services/ske/src/stackit/ske/models/cluster_status_state.py index d7a54bf0..17821142 100644 --- a/services/ske/src/stackit/ske/models/cluster_status_state.py +++ b/services/ske/src/stackit/ske/models/cluster_status_state.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations diff --git a/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py b/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py index 6497e49f..6c2a5ffc 100644 --- a/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py +++ b/services/ske/src/stackit/ske/models/create_kubeconfig_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CreateKubeconfigPayload(BaseModel): """ CreateKubeconfigPayload - """ + """ # noqa: E501 expiration_seconds: Optional[StrictStr] = Field(default=None, alias="expirationSeconds") __properties: ClassVar[List[str]] = ["expirationSeconds"] diff --git a/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py b/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py index bbcd4222..7eb63b01 100644 --- a/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py +++ b/services/ske/src/stackit/ske/models/create_or_update_cluster_payload.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -32,7 +32,7 @@ class CreateOrUpdateClusterPayload(BaseModel): """ CreateOrUpdateClusterPayload - """ + """ # noqa: E501 extensions: Optional[Extension] = None hibernation: Optional[Hibernation] = None diff --git a/services/ske/src/stackit/ske/models/credentials_rotation_state.py b/services/ske/src/stackit/ske/models/credentials_rotation_state.py index 31369153..8c4bc940 100644 --- a/services/ske/src/stackit/ske/models/credentials_rotation_state.py +++ b/services/ske/src/stackit/ske/models/credentials_rotation_state.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class CredentialsRotationState(BaseModel): """ CredentialsRotationState - """ + """ # noqa: E501 last_completion_time: Optional[datetime] = Field( default=None, description="Format: `2024-02-15T11:06:29Z`", alias="lastCompletionTime" diff --git a/services/ske/src/stackit/ske/models/cri.py b/services/ske/src/stackit/ske/models/cri.py index cb38abdc..cb844dbe 100644 --- a/services/ske/src/stackit/ske/models/cri.py +++ b/services/ske/src/stackit/ske/models/cri.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class CRI(BaseModel): """ CRI - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/models/dns.py b/services/ske/src/stackit/ske/models/dns.py index d069540a..3f0ed1ce 100644 --- a/services/ske/src/stackit/ske/models/dns.py +++ b/services/ske/src/stackit/ske/models/dns.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class DNS(BaseModel): """ DNS - """ + """ # noqa: E501 enabled: StrictBool = Field(description="Enables the dns extension.") zones: Optional[Annotated[List[Annotated[str, Field(strict=True)]], Field(max_length=20)]] = Field( diff --git a/services/ske/src/stackit/ske/models/extension.py b/services/ske/src/stackit/ske/models/extension.py index f7bed02b..e32684d7 100644 --- a/services/ske/src/stackit/ske/models/extension.py +++ b/services/ske/src/stackit/ske/models/extension.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -28,7 +28,7 @@ class Extension(BaseModel): """ Extension - """ + """ # noqa: E501 acl: Optional[ACL] = None argus: Optional[Argus] = None diff --git a/services/ske/src/stackit/ske/models/hibernation.py b/services/ske/src/stackit/ske/models/hibernation.py index 58078c70..a0512318 100644 --- a/services/ske/src/stackit/ske/models/hibernation.py +++ b/services/ske/src/stackit/ske/models/hibernation.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Hibernation(BaseModel): """ Hibernation - """ + """ # noqa: E501 schedules: List[HibernationSchedule] __properties: ClassVar[List[str]] = ["schedules"] diff --git a/services/ske/src/stackit/ske/models/hibernation_schedule.py b/services/ske/src/stackit/ske/models/hibernation_schedule.py index 61634af8..41fb6199 100644 --- a/services/ske/src/stackit/ske/models/hibernation_schedule.py +++ b/services/ske/src/stackit/ske/models/hibernation_schedule.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator @@ -25,7 +25,7 @@ class HibernationSchedule(BaseModel): """ HibernationSchedule - """ + """ # noqa: E501 end: Annotated[str, Field(strict=True)] start: Annotated[str, Field(strict=True)] diff --git a/services/ske/src/stackit/ske/models/image.py b/services/ske/src/stackit/ske/models/image.py index 9483ff85..131c6b54 100644 --- a/services/ske/src/stackit/ske/models/image.py +++ b/services/ske/src/stackit/ske/models/image.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Image(BaseModel): """ For valid names and versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `machineImages`. - """ + """ # noqa: E501 name: StrictStr version: StrictStr diff --git a/services/ske/src/stackit/ske/models/kubeconfig.py b/services/ske/src/stackit/ske/models/kubeconfig.py index e4595746..1fe1294a 100644 --- a/services/ske/src/stackit/ske/models/kubeconfig.py +++ b/services/ske/src/stackit/ske/models/kubeconfig.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class Kubeconfig(BaseModel): """ Kubeconfig - """ + """ # noqa: E501 expiration_timestamp: Optional[datetime] = Field(default=None, alias="expirationTimestamp") kubeconfig: Optional[StrictStr] = None diff --git a/services/ske/src/stackit/ske/models/kubernetes.py b/services/ske/src/stackit/ske/models/kubernetes.py index 0f6ff58e..92db51dd 100644 --- a/services/ske/src/stackit/ske/models/kubernetes.py +++ b/services/ske/src/stackit/ske/models/kubernetes.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator @@ -25,7 +25,7 @@ class Kubernetes(BaseModel): """ For valid versions please take a look at [provider-options](#tag/ProviderOptions/operation/SkeService_GetProviderOptions) `kubernetesVersions`. - """ + """ # noqa: E501 allow_privileged_containers: Optional[StrictBool] = Field( default=None, diff --git a/services/ske/src/stackit/ske/models/kubernetes_version.py b/services/ske/src/stackit/ske/models/kubernetes_version.py index 516fdfe0..e4787075 100644 --- a/services/ske/src/stackit/ske/models/kubernetes_version.py +++ b/services/ske/src/stackit/ske/models/kubernetes_version.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -26,7 +26,7 @@ class KubernetesVersion(BaseModel): """ KubernetesVersion - """ + """ # noqa: E501 expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") feature_gates: Optional[Dict[str, StrictStr]] = Field(default=None, alias="featureGates") diff --git a/services/ske/src/stackit/ske/models/list_clusters_response.py b/services/ske/src/stackit/ske/models/list_clusters_response.py index 4061fa55..38455478 100644 --- a/services/ske/src/stackit/ske/models/list_clusters_response.py +++ b/services/ske/src/stackit/ske/models/list_clusters_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListClustersResponse(BaseModel): """ ListClustersResponse - """ + """ # noqa: E501 items: Optional[List[Cluster]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/ske/src/stackit/ske/models/login_kubeconfig.py b/services/ske/src/stackit/ske/models/login_kubeconfig.py index 7573b413..821c11f8 100644 --- a/services/ske/src/stackit/ske/models/login_kubeconfig.py +++ b/services/ske/src/stackit/ske/models/login_kubeconfig.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class LoginKubeconfig(BaseModel): """ LoginKubeconfig - """ + """ # noqa: E501 kubeconfig: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["kubeconfig"] diff --git a/services/ske/src/stackit/ske/models/machine.py b/services/ske/src/stackit/ske/models/machine.py index 1dafce96..1d98a6fc 100644 --- a/services/ske/src/stackit/ske/models/machine.py +++ b/services/ske/src/stackit/ske/models/machine.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class Machine(BaseModel): """ Machine - """ + """ # noqa: E501 image: Image type: StrictStr = Field( diff --git a/services/ske/src/stackit/ske/models/machine_image.py b/services/ske/src/stackit/ske/models/machine_image.py index c482241f..00a7f31c 100644 --- a/services/ske/src/stackit/ske/models/machine_image.py +++ b/services/ske/src/stackit/ske/models/machine_image.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class MachineImage(BaseModel): """ MachineImage - """ + """ # noqa: E501 name: Optional[StrictStr] = None versions: Optional[List[MachineImageVersion]] = None diff --git a/services/ske/src/stackit/ske/models/machine_image_version.py b/services/ske/src/stackit/ske/models/machine_image_version.py index 641e8404..a83b42d2 100644 --- a/services/ske/src/stackit/ske/models/machine_image_version.py +++ b/services/ske/src/stackit/ske/models/machine_image_version.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set @@ -28,7 +28,7 @@ class MachineImageVersion(BaseModel): """ MachineImageVersion - """ + """ # noqa: E501 cri: Optional[List[CRI]] = None expiration_date: Optional[datetime] = Field(default=None, alias="expirationDate") diff --git a/services/ske/src/stackit/ske/models/machine_type.py b/services/ske/src/stackit/ske/models/machine_type.py index ff2cc013..48eaa6c3 100644 --- a/services/ske/src/stackit/ske/models/machine_type.py +++ b/services/ske/src/stackit/ske/models/machine_type.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class MachineType(BaseModel): """ MachineType - """ + """ # noqa: E501 architecture: Optional[StrictStr] = None cpu: Optional[StrictInt] = None diff --git a/services/ske/src/stackit/ske/models/maintenance.py b/services/ske/src/stackit/ske/models/maintenance.py index b2bee629..9b8110cc 100644 --- a/services/ske/src/stackit/ske/models/maintenance.py +++ b/services/ske/src/stackit/ske/models/maintenance.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -27,7 +27,7 @@ class Maintenance(BaseModel): """ Maintenance - """ + """ # noqa: E501 auto_update: MaintenanceAutoUpdate = Field(alias="autoUpdate") time_window: TimeWindow = Field(alias="timeWindow") diff --git a/services/ske/src/stackit/ske/models/maintenance_auto_update.py b/services/ske/src/stackit/ske/models/maintenance_auto_update.py index bf3f9288..de685db9 100644 --- a/services/ske/src/stackit/ske/models/maintenance_auto_update.py +++ b/services/ske/src/stackit/ske/models/maintenance_auto_update.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class MaintenanceAutoUpdate(BaseModel): """ MaintenanceAutoUpdate - """ + """ # noqa: E501 kubernetes_version: Optional[StrictBool] = Field(default=None, alias="kubernetesVersion") machine_image_version: Optional[StrictBool] = Field(default=None, alias="machineImageVersion") diff --git a/services/ske/src/stackit/ske/models/network.py b/services/ske/src/stackit/ske/models/network.py index d3282c1a..b4518103 100644 --- a/services/ske/src/stackit/ske/models/network.py +++ b/services/ske/src/stackit/ske/models/network.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Network(BaseModel): """ Network - """ + """ # noqa: E501 id: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/ske/src/stackit/ske/models/nodepool.py b/services/ske/src/stackit/ske/models/nodepool.py index 0bf62610..20f5d001 100644 --- a/services/ske/src/stackit/ske/models/nodepool.py +++ b/services/ske/src/stackit/ske/models/nodepool.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -29,7 +29,7 @@ class Nodepool(BaseModel): """ Nodepool - """ + """ # noqa: E501 allow_system_components: Optional[StrictBool] = Field( default=None, description="This needs to be true for at least one node pool.", alias="allowSystemComponents" diff --git a/services/ske/src/stackit/ske/models/provider_options.py b/services/ske/src/stackit/ske/models/provider_options.py index 3a6699d3..f4b06be4 100644 --- a/services/ske/src/stackit/ske/models/provider_options.py +++ b/services/ske/src/stackit/ske/models/provider_options.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -30,7 +30,7 @@ class ProviderOptions(BaseModel): """ ProviderOptions - """ + """ # noqa: E501 availability_zones: Optional[List[AvailabilityZone]] = Field(default=None, alias="availabilityZones") kubernetes_versions: Optional[List[KubernetesVersion]] = Field(default=None, alias="kubernetesVersions") diff --git a/services/ske/src/stackit/ske/models/runtime_error.py b/services/ske/src/stackit/ske/models/runtime_error.py index d05a6f96..309bcea8 100644 --- a/services/ske/src/stackit/ske/models/runtime_error.py +++ b/services/ske/src/stackit/ske/models/runtime_error.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class RuntimeError(BaseModel): """ RuntimeError - """ + """ # noqa: E501 code: Optional[StrictStr] = Field( default=None, diff --git a/services/ske/src/stackit/ske/models/taint.py b/services/ske/src/stackit/ske/models/taint.py index b4d7be73..ca9069a2 100644 --- a/services/ske/src/stackit/ske/models/taint.py +++ b/services/ske/src/stackit/ske/models/taint.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Taint(BaseModel): """ Taint - """ + """ # noqa: E501 effect: StrictStr key: StrictStr diff --git a/services/ske/src/stackit/ske/models/time_window.py b/services/ske/src/stackit/ske/models/time_window.py index 0bbdbe72..34b67332 100644 --- a/services/ske/src/stackit/ske/models/time_window.py +++ b/services/ske/src/stackit/ske/models/time_window.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class TimeWindow(BaseModel): """ TimeWindow - """ + """ # noqa: E501 end: datetime start: datetime diff --git a/services/ske/src/stackit/ske/models/volume.py b/services/ske/src/stackit/ske/models/volume.py index e27c288e..460cd437 100644 --- a/services/ske/src/stackit/ske/models/volume.py +++ b/services/ske/src/stackit/ske/models/volume.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Volume(BaseModel): """ Volume - """ + """ # noqa: E501 size: Annotated[int, Field(le=10240, strict=True, ge=20)] type: Optional[StrictStr] = Field( diff --git a/services/ske/src/stackit/ske/models/volume_type.py b/services/ske/src/stackit/ske/models/volume_type.py index 0d70b8dd..0344aee7 100644 --- a/services/ske/src/stackit/ske/models/volume_type.py +++ b/services/ske/src/stackit/ske/models/volume_type.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class VolumeType(BaseModel): """ VolumeType - """ + """ # noqa: E501 name: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["name"] diff --git a/services/ske/src/stackit/ske/rest.py b/services/ske/src/stackit/ske/rest.py index 1e2fe8e1..f1596f21 100644 --- a/services/ske/src/stackit/ske/rest.py +++ b/services/ske/src/stackit/ske/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: