diff --git a/services/serviceenablement/src/stackit/serviceenablement/__init__.py b/services/serviceenablement/src/stackit/serviceenablement/__init__.py index 3ee40610..ffb121cf 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/__init__.py +++ b/services/serviceenablement/src/stackit/serviceenablement/__init__.py @@ -11,36 +11,65 @@ 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", + "ActionError", + "CheckService", + "CloudService", + "Dependencies", + "ErrorResponse", + "ListServiceStatusRegional200Response", + "Parameters", + "ParametersGeneral", + "ServiceStatus", +] + # import apis into sdk package -from stackit.serviceenablement.api.default_api import DefaultApi -from stackit.serviceenablement.api_client import ApiClient +from stackit.serviceenablement.api.default_api import DefaultApi as DefaultApi +from stackit.serviceenablement.api_client import ApiClient as ApiClient # import ApiClient -from stackit.serviceenablement.api_response import ApiResponse -from stackit.serviceenablement.configuration import HostConfiguration -from stackit.serviceenablement.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, +from stackit.serviceenablement.api_response import ApiResponse as ApiResponse +from stackit.serviceenablement.configuration import ( + HostConfiguration as HostConfiguration, ) +from stackit.serviceenablement.exceptions import ApiAttributeError as ApiAttributeError +from stackit.serviceenablement.exceptions import ApiException as ApiException +from stackit.serviceenablement.exceptions import ApiKeyError as ApiKeyError +from stackit.serviceenablement.exceptions import ApiTypeError as ApiTypeError +from stackit.serviceenablement.exceptions import ApiValueError as ApiValueError +from stackit.serviceenablement.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.serviceenablement.models.action_error import ActionError -from stackit.serviceenablement.models.check_service import CheckService -from stackit.serviceenablement.models.cloud_service import CloudService -from stackit.serviceenablement.models.dependencies import Dependencies -from stackit.serviceenablement.models.error_response import ErrorResponse +from stackit.serviceenablement.models.action_error import ActionError as ActionError +from stackit.serviceenablement.models.check_service import CheckService as CheckService +from stackit.serviceenablement.models.cloud_service import CloudService as CloudService +from stackit.serviceenablement.models.dependencies import Dependencies as Dependencies +from stackit.serviceenablement.models.error_response import ( + ErrorResponse as ErrorResponse, +) from stackit.serviceenablement.models.list_service_status_regional200_response import ( - ListServiceStatusRegional200Response, + ListServiceStatusRegional200Response as ListServiceStatusRegional200Response, +) +from stackit.serviceenablement.models.parameters import Parameters as Parameters +from stackit.serviceenablement.models.parameters_general import ( + ParametersGeneral as ParametersGeneral, +) +from stackit.serviceenablement.models.service_status import ( + ServiceStatus as ServiceStatus, ) -from stackit.serviceenablement.models.parameters import Parameters -from stackit.serviceenablement.models.parameters_general import ParametersGeneral -from stackit.serviceenablement.models.service_status import ServiceStatus diff --git a/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py b/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py index 90948a48..01cc9c21 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/api/default_api.py +++ b/services/serviceenablement/src/stackit/serviceenablement/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 @@ -85,7 +85,7 @@ def disable_service_regional( 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._disable_service_regional_serialize( region=region, @@ -157,7 +157,7 @@ def disable_service_regional_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._disable_service_regional_serialize( region=region, @@ -229,7 +229,7 @@ def disable_service_regional_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._disable_service_regional_serialize( region=region, @@ -270,7 +270,7 @@ def _disable_service_regional_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 @@ -353,7 +353,7 @@ def enable_service_regional( 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._enable_service_regional_serialize( region=region, @@ -425,7 +425,7 @@ def enable_service_regional_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._enable_service_regional_serialize( region=region, @@ -497,7 +497,7 @@ def enable_service_regional_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._enable_service_regional_serialize( region=region, @@ -538,7 +538,7 @@ def _enable_service_regional_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 @@ -621,7 +621,7 @@ def get_service_status_regional( 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_service_status_regional_serialize( region=region, @@ -693,7 +693,7 @@ def get_service_status_regional_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_service_status_regional_serialize( region=region, @@ -765,7 +765,7 @@ def get_service_status_regional_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_service_status_regional_serialize( region=region, @@ -806,7 +806,7 @@ def _get_service_status_regional_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 @@ -889,7 +889,7 @@ def list_service_status_regional( 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_service_status_regional_serialize( region=region, @@ -960,7 +960,7 @@ def list_service_status_regional_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_service_status_regional_serialize( region=region, @@ -1031,7 +1031,7 @@ def list_service_status_regional_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_service_status_regional_serialize( region=region, @@ -1071,7 +1071,7 @@ def _list_service_status_regional_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/serviceenablement/src/stackit/serviceenablement/api_client.py b/services/serviceenablement/src/stackit/serviceenablement/api_client.py index f0b478a9..4a713467 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/api_client.py +++ b/services/serviceenablement/src/stackit/serviceenablement/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/serviceenablement/src/stackit/serviceenablement/configuration.py b/services/serviceenablement/src/stackit/serviceenablement/configuration.py index c99a2c17..eea549ea 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/configuration.py +++ b/services/serviceenablement/src/stackit/serviceenablement/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Service Enablement 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 @@ -71,7 +88,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 @@ -111,7 +133,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"]) @@ -130,12 +152,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/serviceenablement/src/stackit/serviceenablement/exceptions.py b/services/serviceenablement/src/stackit/serviceenablement/exceptions.py index d62482df..8c593c3c 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/exceptions.py +++ b/services/serviceenablement/src/stackit/serviceenablement/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/serviceenablement/src/stackit/serviceenablement/models/__init__.py b/services/serviceenablement/src/stackit/serviceenablement/models/__init__.py index db4a9e4a..7a49a423 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/__init__.py +++ b/services/serviceenablement/src/stackit/serviceenablement/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/serviceenablement/src/stackit/serviceenablement/models/action_error.py b/services/serviceenablement/src/stackit/serviceenablement/models/action_error.py index 8cbb31dc..5e33bcf6 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/action_error.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/action_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 ActionError(BaseModel): """ the last error for this service. - """ + """ # noqa: E501 action: Optional[StrictStr] = Field(default=None, description="the last action which was triggered on this service") code: Optional[StrictStr] = Field(default=None, description="the error code if provided by the service") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py b/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py index b1e8570e..bccdf41f 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/check_service.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/check_service.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 CheckService(BaseModel): """ CheckService - """ + """ # noqa: E501 resource: Optional[StrictStr] = Field(default=None, description="the identifier of the resource e.g. projectID") resource_type: Optional[StrictStr] = Field(default="project", alias="resourceType") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py b/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py index 84326ece..3ea90523 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/cloud_service.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 @@ -27,7 +27,7 @@ class CloudService(BaseModel): """ CloudService - """ + """ # noqa: E501 dependencies: Optional[Dependencies] = None labels: Optional[Dict[str, StrictStr]] = None diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py b/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py index 3b55dd6f..460ddae1 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/dependencies.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 Dependencies(BaseModel): """ Dependencies - """ + """ # noqa: E501 hard: Optional[List[Annotated[str, Field(min_length=10, strict=True, max_length=255)]]] = Field( default=None, diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py b/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py index f5c14367..3419206e 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/error_response.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/error_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 @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 error: Optional[StrictStr] = None message: Optional[StrictStr] = None diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py b/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py index f4b68605..225cd286 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_response.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/list_service_status_regional200_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 ListServiceStatusRegional200Response(BaseModel): """ ListServiceStatusRegional200Response - """ + """ # noqa: E501 items: Optional[List[ServiceStatus]] = None next_cursor: Optional[StrictStr] = Field(default=None, alias="nextCursor") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py b/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py index f189402c..228cd00d 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/parameters.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/parameters.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 Parameters(BaseModel): """ service parameters - """ + """ # noqa: E501 general: Optional[ParametersGeneral] = None additional_properties: Dict[str, Any] = {} diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py b/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py index ab8d103e..91852630 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/parameters_general.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 ParametersGeneral(BaseModel): """ ParametersGeneral - """ + """ # noqa: E501 organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") project_name: Optional[StrictStr] = Field(default=None, alias="projectName") diff --git a/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py b/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py index 1798932c..1819e16e 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/models/service_status.py +++ b/services/serviceenablement/src/stackit/serviceenablement/models/service_status.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 @@ -29,7 +29,7 @@ class ServiceStatus(BaseModel): """ ServiceStatus - """ + """ # noqa: E501 dependencies: Optional[Dependencies] = None enablement: Optional[StrictStr] = "REQUEST" diff --git a/services/serviceenablement/src/stackit/serviceenablement/rest.py b/services/serviceenablement/src/stackit/serviceenablement/rest.py index 11b85091..8a53c0af 100644 --- a/services/serviceenablement/src/stackit/serviceenablement/rest.py +++ b/services/serviceenablement/src/stackit/serviceenablement/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: