diff --git a/services/runcommand/src/stackit/runcommand/__init__.py b/services/runcommand/src/stackit/runcommand/__init__.py index 5ec28d7b..2624da33 100644 --- a/services/runcommand/src/stackit/runcommand/__init__.py +++ b/services/runcommand/src/stackit/runcommand/__init__.py @@ -12,37 +12,75 @@ 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", + "CommandDetails", + "CommandTemplate", + "CommandTemplateResponse", + "CommandTemplateSchema", + "Commands", + "CreateCommandPayload", + "ErrorResponse", + "GetCommandsResponse", + "ModelField", + "NewCommandResponse", + "ParametersSchema", + "Properties", +] + # import apis into sdk package -from stackit.runcommand.api.default_api import DefaultApi -from stackit.runcommand.api_client import ApiClient +from stackit.runcommand.api.default_api import DefaultApi as DefaultApi +from stackit.runcommand.api_client import ApiClient as ApiClient # import ApiClient -from stackit.runcommand.api_response import ApiResponse -from stackit.runcommand.configuration import HostConfiguration -from stackit.runcommand.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.runcommand.api_response import ApiResponse as ApiResponse +from stackit.runcommand.configuration import HostConfiguration as HostConfiguration +from stackit.runcommand.exceptions import ApiAttributeError as ApiAttributeError +from stackit.runcommand.exceptions import ApiException as ApiException +from stackit.runcommand.exceptions import ApiKeyError as ApiKeyError +from stackit.runcommand.exceptions import ApiTypeError as ApiTypeError +from stackit.runcommand.exceptions import ApiValueError as ApiValueError +from stackit.runcommand.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.runcommand.models.command_details import CommandDetails -from stackit.runcommand.models.command_template import CommandTemplate -from stackit.runcommand.models.command_template_response import CommandTemplateResponse -from stackit.runcommand.models.command_template_schema import CommandTemplateSchema -from stackit.runcommand.models.commands import Commands -from stackit.runcommand.models.create_command_payload import CreateCommandPayload -from stackit.runcommand.models.error_response import ErrorResponse -from stackit.runcommand.models.get_commands_response import GetCommandsResponse -from stackit.runcommand.models.model_field import ModelField -from stackit.runcommand.models.new_command_response import NewCommandResponse -from stackit.runcommand.models.parameters_schema import ParametersSchema -from stackit.runcommand.models.properties import Properties +from stackit.runcommand.models.command_details import CommandDetails as CommandDetails +from stackit.runcommand.models.command_template import ( + CommandTemplate as CommandTemplate, +) +from stackit.runcommand.models.command_template_response import ( + CommandTemplateResponse as CommandTemplateResponse, +) +from stackit.runcommand.models.command_template_schema import ( + CommandTemplateSchema as CommandTemplateSchema, +) +from stackit.runcommand.models.commands import Commands as Commands +from stackit.runcommand.models.create_command_payload import ( + CreateCommandPayload as CreateCommandPayload, +) +from stackit.runcommand.models.error_response import ErrorResponse as ErrorResponse +from stackit.runcommand.models.get_commands_response import ( + GetCommandsResponse as GetCommandsResponse, +) +from stackit.runcommand.models.model_field import ModelField as ModelField +from stackit.runcommand.models.new_command_response import ( + NewCommandResponse as NewCommandResponse, +) +from stackit.runcommand.models.parameters_schema import ( + ParametersSchema as ParametersSchema, +) +from stackit.runcommand.models.properties import Properties as Properties diff --git a/services/runcommand/src/stackit/runcommand/api/default_api.py b/services/runcommand/src/stackit/runcommand/api/default_api.py index 698a2b2e..02c58081 100644 --- a/services/runcommand/src/stackit/runcommand/api/default_api.py +++ b/services/runcommand/src/stackit/runcommand/api/default_api.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 from typing import Any, Dict, List, Optional, Tuple, Union @@ -91,7 +91,7 @@ def create_command( 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_command_serialize( project_id=project_id, @@ -166,7 +166,7 @@ def create_command_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_command_serialize( project_id=project_id, @@ -241,7 +241,7 @@ def create_command_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_command_serialize( project_id=project_id, @@ -283,7 +283,7 @@ def _create_command_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 @@ -379,7 +379,7 @@ def get_command( 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_command_serialize( project_id=project_id, @@ -454,7 +454,7 @@ def get_command_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_command_serialize( project_id=project_id, @@ -529,7 +529,7 @@ def get_command_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_command_serialize( project_id=project_id, @@ -571,7 +571,7 @@ def _get_command_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 @@ -659,7 +659,7 @@ def get_command_template( 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_command_template_serialize( project_id=project_id, @@ -734,7 +734,7 @@ def get_command_template_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_command_template_serialize( project_id=project_id, @@ -809,7 +809,7 @@ def get_command_template_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_command_template_serialize( project_id=project_id, @@ -851,7 +851,7 @@ def _get_command_template_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 @@ -935,7 +935,7 @@ def list_command_templates( 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_command_templates_serialize( os_type=os_type, @@ -1002,7 +1002,7 @@ def list_command_templates_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_command_templates_serialize( os_type=os_type, @@ -1069,7 +1069,7 @@ def list_command_templates_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_command_templates_serialize( os_type=os_type, @@ -1104,7 +1104,7 @@ def _list_command_templates_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 @@ -1185,7 +1185,7 @@ def list_commands( 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_commands_serialize( project_id=project_id, @@ -1256,7 +1256,7 @@ def list_commands_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_commands_serialize( project_id=project_id, @@ -1327,7 +1327,7 @@ def list_commands_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_commands_serialize( project_id=project_id, @@ -1367,7 +1367,7 @@ def _list_commands_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/runcommand/src/stackit/runcommand/api_client.py b/services/runcommand/src/stackit/runcommand/api_client.py index 10e29170..308b91ea 100644 --- a/services/runcommand/src/stackit/runcommand/api_client.py +++ b/services/runcommand/src/stackit/runcommand/api_client.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 datetime import json @@ -332,6 +332,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]): @@ -351,12 +355,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)) @@ -458,7 +462,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 = " " @@ -474,7 +478,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. @@ -489,6 +496,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/runcommand/src/stackit/runcommand/configuration.py b/services/runcommand/src/stackit/runcommand/configuration.py index 9506b757..4f40b7f2 100644 --- a/services/runcommand/src/stackit/runcommand/configuration.py +++ b/services/runcommand/src/stackit/runcommand/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Run Commands Service API @@ -15,7 +10,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: @@ -54,7 +71,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/runcommand/src/stackit/runcommand/exceptions.py b/services/runcommand/src/stackit/runcommand/exceptions.py index 5e72b3c0..12c3fd15 100644 --- a/services/runcommand/src/stackit/runcommand/exceptions.py +++ b/services/runcommand/src/stackit/runcommand/exceptions.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 from typing import Any, Optional @@ -128,7 +128,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() @@ -152,6 +152,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) @@ -188,6 +195,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/runcommand/src/stackit/runcommand/models/__init__.py b/services/runcommand/src/stackit/runcommand/models/__init__.py index 973ced42..1d83b071 100644 --- a/services/runcommand/src/stackit/runcommand/models/__init__.py +++ b/services/runcommand/src/stackit/runcommand/models/__init__.py @@ -11,7 +11,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/runcommand/src/stackit/runcommand/models/command_details.py b/services/runcommand/src/stackit/runcommand/models/command_details.py index 7b50b502..cf6b325c 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_details.py +++ b/services/runcommand/src/stackit/runcommand/models/command_details.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 from __future__ import annotations @@ -25,7 +25,7 @@ class CommandDetails(BaseModel): """ CommandDetails - """ + """ # noqa: E501 command_template_name: Optional[StrictStr] = Field(default=None, alias="commandTemplateName") command_template_title: Optional[StrictStr] = Field(default=None, alias="commandTemplateTitle") diff --git a/services/runcommand/src/stackit/runcommand/models/command_template.py b/services/runcommand/src/stackit/runcommand/models/command_template.py index 3f2600d2..b02cd1cd 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_template.py +++ b/services/runcommand/src/stackit/runcommand/models/command_template.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 from __future__ import annotations @@ -25,7 +25,7 @@ class CommandTemplate(BaseModel): """ CommandTemplate - """ + """ # noqa: E501 name: Optional[StrictStr] = None os_type: Optional[List[StrictStr]] = Field(default=None, alias="osType") diff --git a/services/runcommand/src/stackit/runcommand/models/command_template_response.py b/services/runcommand/src/stackit/runcommand/models/command_template_response.py index 00dcc0c7..7765787c 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_template_response.py +++ b/services/runcommand/src/stackit/runcommand/models/command_template_response.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 from __future__ import annotations @@ -27,7 +27,7 @@ class CommandTemplateResponse(BaseModel): """ CommandTemplateResponse - """ + """ # noqa: E501 items: Optional[List[CommandTemplate]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/runcommand/src/stackit/runcommand/models/command_template_schema.py b/services/runcommand/src/stackit/runcommand/models/command_template_schema.py index 323cf018..b9392e28 100644 --- a/services/runcommand/src/stackit/runcommand/models/command_template_schema.py +++ b/services/runcommand/src/stackit/runcommand/models/command_template_schema.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 from __future__ import annotations @@ -27,7 +27,7 @@ class CommandTemplateSchema(BaseModel): """ CommandTemplateSchema - """ + """ # noqa: E501 description: Optional[StrictStr] = None name: Optional[StrictStr] = None diff --git a/services/runcommand/src/stackit/runcommand/models/commands.py b/services/runcommand/src/stackit/runcommand/models/commands.py index c3836ce0..cddd29b9 100644 --- a/services/runcommand/src/stackit/runcommand/models/commands.py +++ b/services/runcommand/src/stackit/runcommand/models/commands.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 from __future__ import annotations @@ -25,7 +25,7 @@ class Commands(BaseModel): """ Commands - """ + """ # noqa: E501 command_template_name: Optional[StrictStr] = Field(default=None, alias="commandTemplateName") command_template_title: Optional[StrictStr] = Field(default=None, alias="commandTemplateTitle") diff --git a/services/runcommand/src/stackit/runcommand/models/create_command_payload.py b/services/runcommand/src/stackit/runcommand/models/create_command_payload.py index 80a886ab..19875b7e 100644 --- a/services/runcommand/src/stackit/runcommand/models/create_command_payload.py +++ b/services/runcommand/src/stackit/runcommand/models/create_command_payload.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 from __future__ import annotations @@ -25,7 +25,7 @@ class CreateCommandPayload(BaseModel): """ CreateCommandPayload - """ + """ # noqa: E501 command_template_name: StrictStr = Field(alias="commandTemplateName") parameters: Optional[Dict[str, StrictStr]] = None diff --git a/services/runcommand/src/stackit/runcommand/models/error_response.py b/services/runcommand/src/stackit/runcommand/models/error_response.py index 3519fd03..14b35765 100644 --- a/services/runcommand/src/stackit/runcommand/models/error_response.py +++ b/services/runcommand/src/stackit/runcommand/models/error_response.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 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 message: StrictStr = Field(description="Details about the error") status: StrictStr = Field( diff --git a/services/runcommand/src/stackit/runcommand/models/get_commands_response.py b/services/runcommand/src/stackit/runcommand/models/get_commands_response.py index 46119d20..2f8fa8d7 100644 --- a/services/runcommand/src/stackit/runcommand/models/get_commands_response.py +++ b/services/runcommand/src/stackit/runcommand/models/get_commands_response.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 from __future__ import annotations @@ -27,7 +27,7 @@ class GetCommandsResponse(BaseModel): """ GetCommandsResponse - """ + """ # noqa: E501 items: Optional[List[Commands]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/runcommand/src/stackit/runcommand/models/model_field.py b/services/runcommand/src/stackit/runcommand/models/model_field.py index 8a99ba04..5749f4d3 100644 --- a/services/runcommand/src/stackit/runcommand/models/model_field.py +++ b/services/runcommand/src/stackit/runcommand/models/model_field.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 from __future__ import annotations @@ -25,7 +25,7 @@ class ModelField(BaseModel): """ ModelField - """ + """ # noqa: E501 default: Optional[StrictStr] = None description: Optional[StrictStr] = None diff --git a/services/runcommand/src/stackit/runcommand/models/new_command_response.py b/services/runcommand/src/stackit/runcommand/models/new_command_response.py index 76d47f9b..fa5b7f7c 100644 --- a/services/runcommand/src/stackit/runcommand/models/new_command_response.py +++ b/services/runcommand/src/stackit/runcommand/models/new_command_response.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 from __future__ import annotations @@ -25,7 +25,7 @@ class NewCommandResponse(BaseModel): """ NewCommandResponse - """ + """ # noqa: E501 id: Optional[StrictInt] = None __properties: ClassVar[List[str]] = ["id"] diff --git a/services/runcommand/src/stackit/runcommand/models/parameters_schema.py b/services/runcommand/src/stackit/runcommand/models/parameters_schema.py index 10c5c04a..cffe6a4b 100644 --- a/services/runcommand/src/stackit/runcommand/models/parameters_schema.py +++ b/services/runcommand/src/stackit/runcommand/models/parameters_schema.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 from __future__ import annotations @@ -27,7 +27,7 @@ class ParametersSchema(BaseModel): """ ParametersSchema - """ + """ # noqa: E501 properties: Optional[Properties] = None __properties: ClassVar[List[str]] = ["properties"] diff --git a/services/runcommand/src/stackit/runcommand/models/properties.py b/services/runcommand/src/stackit/runcommand/models/properties.py index 3f02114f..e00cd995 100644 --- a/services/runcommand/src/stackit/runcommand/models/properties.py +++ b/services/runcommand/src/stackit/runcommand/models/properties.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 from __future__ import annotations @@ -27,7 +27,7 @@ class Properties(BaseModel): """ Properties - """ + """ # noqa: E501 confirm_password: Optional[ModelField] = Field(default=None, alias="ConfirmPassword") password: Optional[ModelField] = Field(default=None, alias="Password") diff --git a/services/runcommand/src/stackit/runcommand/rest.py b/services/runcommand/src/stackit/runcommand/rest.py index 2f12fce6..570d696a 100644 --- a/services/runcommand/src/stackit/runcommand/rest.py +++ b/services/runcommand/src/stackit/runcommand/rest.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 io import json @@ -125,7 +125,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: