From 0ef08b269e9ede0523b5ba9efc73c3d701977261 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 4 Jul 2025 07:30:21 +0000 Subject: [PATCH] Generate kms --- services/kms/src/stackit/kms/__init__.py | 120 +++++++---- .../kms/src/stackit/kms/api/default_api.py | 202 +++++++++--------- services/kms/src/stackit/kms/api_client.py | 23 +- services/kms/src/stackit/kms/configuration.py | 44 +++- services/kms/src/stackit/kms/exceptions.py | 23 +- .../kms/src/stackit/kms/models/__init__.py | 2 +- .../kms/src/stackit/kms/models/algorithm.py | 2 +- .../kms/src/stackit/kms/models/backend.py | 2 +- .../stackit/kms/models/create_key_payload.py | 4 +- .../kms/models/create_key_ring_payload.py | 4 +- .../kms/models/create_wrapping_key_payload.py | 4 +- .../src/stackit/kms/models/decrypt_payload.py | 4 +- .../src/stackit/kms/models/decrypted_data.py | 4 +- .../src/stackit/kms/models/encrypt_payload.py | 4 +- .../src/stackit/kms/models/encrypted_data.py | 4 +- .../kms/src/stackit/kms/models/http_error.py | 4 +- .../stackit/kms/models/import_key_payload.py | 4 +- services/kms/src/stackit/kms/models/key.py | 4 +- .../kms/src/stackit/kms/models/key_list.py | 4 +- .../kms/src/stackit/kms/models/key_ring.py | 4 +- .../src/stackit/kms/models/key_ring_list.py | 4 +- .../kms/src/stackit/kms/models/purpose.py | 2 +- .../src/stackit/kms/models/sign_payload.py | 4 +- .../kms/src/stackit/kms/models/signed_data.py | 4 +- .../src/stackit/kms/models/verified_data.py | 4 +- .../src/stackit/kms/models/verify_payload.py | 4 +- .../kms/src/stackit/kms/models/version.py | 4 +- .../src/stackit/kms/models/version_list.py | 4 +- .../stackit/kms/models/wrapping_algorithm.py | 2 +- .../src/stackit/kms/models/wrapping_key.py | 4 +- .../stackit/kms/models/wrapping_key_list.py | 4 +- .../stackit/kms/models/wrapping_purpose.py | 2 +- services/kms/src/stackit/kms/rest.py | 4 +- 33 files changed, 304 insertions(+), 208 deletions(-) diff --git a/services/kms/src/stackit/kms/__init__.py b/services/kms/src/stackit/kms/__init__.py index 7ada5189..2bdbde05 100644 --- a/services/kms/src/stackit/kms/__init__.py +++ b/services/kms/src/stackit/kms/__init__.py @@ -11,51 +11,93 @@ 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", + "Algorithm", + "Backend", + "CreateKeyPayload", + "CreateKeyRingPayload", + "CreateWrappingKeyPayload", + "DecryptPayload", + "DecryptedData", + "EncryptPayload", + "EncryptedData", + "HttpError", + "ImportKeyPayload", + "Key", + "KeyList", + "KeyRing", + "KeyRingList", + "Purpose", + "SignPayload", + "SignedData", + "VerifiedData", + "VerifyPayload", + "Version", + "VersionList", + "WrappingAlgorithm", + "WrappingKey", + "WrappingKeyList", + "WrappingPurpose", +] + # import apis into sdk package -from stackit.kms.api.default_api import DefaultApi -from stackit.kms.api_client import ApiClient +from stackit.kms.api.default_api import DefaultApi as DefaultApi +from stackit.kms.api_client import ApiClient as ApiClient # import ApiClient -from stackit.kms.api_response import ApiResponse -from stackit.kms.configuration import HostConfiguration -from stackit.kms.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.kms.api_response import ApiResponse as ApiResponse +from stackit.kms.configuration import HostConfiguration as HostConfiguration +from stackit.kms.exceptions import ApiAttributeError as ApiAttributeError +from stackit.kms.exceptions import ApiException as ApiException +from stackit.kms.exceptions import ApiKeyError as ApiKeyError +from stackit.kms.exceptions import ApiTypeError as ApiTypeError +from stackit.kms.exceptions import ApiValueError as ApiValueError +from stackit.kms.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.kms.models.algorithm import Algorithm -from stackit.kms.models.backend import Backend -from stackit.kms.models.create_key_payload import CreateKeyPayload -from stackit.kms.models.create_key_ring_payload import CreateKeyRingPayload -from stackit.kms.models.create_wrapping_key_payload import CreateWrappingKeyPayload -from stackit.kms.models.decrypt_payload import DecryptPayload -from stackit.kms.models.decrypted_data import DecryptedData -from stackit.kms.models.encrypt_payload import EncryptPayload -from stackit.kms.models.encrypted_data import EncryptedData -from stackit.kms.models.http_error import HttpError -from stackit.kms.models.import_key_payload import ImportKeyPayload -from stackit.kms.models.key import Key -from stackit.kms.models.key_list import KeyList -from stackit.kms.models.key_ring import KeyRing -from stackit.kms.models.key_ring_list import KeyRingList -from stackit.kms.models.purpose import Purpose -from stackit.kms.models.sign_payload import SignPayload -from stackit.kms.models.signed_data import SignedData -from stackit.kms.models.verified_data import VerifiedData -from stackit.kms.models.verify_payload import VerifyPayload -from stackit.kms.models.version import Version -from stackit.kms.models.version_list import VersionList -from stackit.kms.models.wrapping_algorithm import WrappingAlgorithm -from stackit.kms.models.wrapping_key import WrappingKey -from stackit.kms.models.wrapping_key_list import WrappingKeyList -from stackit.kms.models.wrapping_purpose import WrappingPurpose +from stackit.kms.models.algorithm import Algorithm as Algorithm +from stackit.kms.models.backend import Backend as Backend +from stackit.kms.models.create_key_payload import CreateKeyPayload as CreateKeyPayload +from stackit.kms.models.create_key_ring_payload import ( + CreateKeyRingPayload as CreateKeyRingPayload, +) +from stackit.kms.models.create_wrapping_key_payload import ( + CreateWrappingKeyPayload as CreateWrappingKeyPayload, +) +from stackit.kms.models.decrypt_payload import DecryptPayload as DecryptPayload +from stackit.kms.models.decrypted_data import DecryptedData as DecryptedData +from stackit.kms.models.encrypt_payload import EncryptPayload as EncryptPayload +from stackit.kms.models.encrypted_data import EncryptedData as EncryptedData +from stackit.kms.models.http_error import HttpError as HttpError +from stackit.kms.models.import_key_payload import ImportKeyPayload as ImportKeyPayload +from stackit.kms.models.key import Key as Key +from stackit.kms.models.key_list import KeyList as KeyList +from stackit.kms.models.key_ring import KeyRing as KeyRing +from stackit.kms.models.key_ring_list import KeyRingList as KeyRingList +from stackit.kms.models.purpose import Purpose as Purpose +from stackit.kms.models.sign_payload import SignPayload as SignPayload +from stackit.kms.models.signed_data import SignedData as SignedData +from stackit.kms.models.verified_data import VerifiedData as VerifiedData +from stackit.kms.models.verify_payload import VerifyPayload as VerifyPayload +from stackit.kms.models.version import Version as Version +from stackit.kms.models.version_list import VersionList as VersionList +from stackit.kms.models.wrapping_algorithm import WrappingAlgorithm as WrappingAlgorithm +from stackit.kms.models.wrapping_key import WrappingKey as WrappingKey +from stackit.kms.models.wrapping_key_list import WrappingKeyList as WrappingKeyList +from stackit.kms.models.wrapping_purpose import WrappingPurpose as WrappingPurpose diff --git a/services/kms/src/stackit/kms/api/default_api.py b/services/kms/src/stackit/kms/api/default_api.py index 68e682df..99710145 100644 --- a/services/kms/src/stackit/kms/api/default_api.py +++ b/services/kms/src/stackit/kms/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 @@ -110,7 +110,7 @@ def create_key( 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_key_serialize( project_id=project_id, @@ -186,7 +186,7 @@ def create_key_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_key_serialize( project_id=project_id, @@ -262,7 +262,7 @@ def create_key_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_key_serialize( project_id=project_id, @@ -305,7 +305,7 @@ def _create_key_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 @@ -398,7 +398,7 @@ def create_key_ring( 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_key_ring_serialize( project_id=project_id, @@ -469,7 +469,7 @@ def create_key_ring_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_key_ring_serialize( project_id=project_id, @@ -540,7 +540,7 @@ def create_key_ring_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_key_ring_serialize( project_id=project_id, @@ -580,7 +580,7 @@ def _create_key_ring_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 @@ -674,7 +674,7 @@ def create_wrapping_key( 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_wrapping_key_serialize( project_id=project_id, @@ -750,7 +750,7 @@ def create_wrapping_key_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_wrapping_key_serialize( project_id=project_id, @@ -826,7 +826,7 @@ def create_wrapping_key_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_wrapping_key_serialize( project_id=project_id, @@ -869,7 +869,7 @@ def _create_wrapping_key_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 @@ -971,7 +971,7 @@ def decrypt( 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._decrypt_serialize( project_id=project_id, @@ -1056,7 +1056,7 @@ def decrypt_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._decrypt_serialize( project_id=project_id, @@ -1141,7 +1141,7 @@ def decrypt_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._decrypt_serialize( project_id=project_id, @@ -1189,7 +1189,7 @@ def _decrypt_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 @@ -1289,7 +1289,7 @@ def delete_key( 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_key_serialize( project_id=project_id, @@ -1365,7 +1365,7 @@ def delete_key_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_key_serialize( project_id=project_id, @@ -1441,7 +1441,7 @@ def delete_key_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_key_serialize( project_id=project_id, @@ -1484,7 +1484,7 @@ def _delete_key_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 @@ -1569,7 +1569,7 @@ def delete_key_ring( 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_key_ring_serialize( project_id=project_id, @@ -1641,7 +1641,7 @@ def delete_key_ring_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_key_ring_serialize( project_id=project_id, @@ -1713,7 +1713,7 @@ def delete_key_ring_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_key_ring_serialize( project_id=project_id, @@ -1754,7 +1754,7 @@ def _delete_key_ring_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 @@ -1840,7 +1840,7 @@ def delete_wrapping_key( 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_wrapping_key_serialize( project_id=project_id, @@ -1916,7 +1916,7 @@ def delete_wrapping_key_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_wrapping_key_serialize( project_id=project_id, @@ -1992,7 +1992,7 @@ def delete_wrapping_key_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_wrapping_key_serialize( project_id=project_id, @@ -2035,7 +2035,7 @@ def _delete_wrapping_key_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 @@ -2126,7 +2126,7 @@ def destroy_version( 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._destroy_version_serialize( project_id=project_id, @@ -2206,7 +2206,7 @@ def destroy_version_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._destroy_version_serialize( project_id=project_id, @@ -2286,7 +2286,7 @@ def destroy_version_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._destroy_version_serialize( project_id=project_id, @@ -2331,7 +2331,7 @@ def _destroy_version_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 @@ -2424,7 +2424,7 @@ def disable_version( 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_version_serialize( project_id=project_id, @@ -2504,7 +2504,7 @@ def disable_version_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_version_serialize( project_id=project_id, @@ -2584,7 +2584,7 @@ def disable_version_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_version_serialize( project_id=project_id, @@ -2629,7 +2629,7 @@ def _disable_version_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 @@ -2722,7 +2722,7 @@ def enable_version( 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_version_serialize( project_id=project_id, @@ -2802,7 +2802,7 @@ def enable_version_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_version_serialize( project_id=project_id, @@ -2882,7 +2882,7 @@ def enable_version_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_version_serialize( project_id=project_id, @@ -2927,7 +2927,7 @@ def _enable_version_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 @@ -3023,7 +3023,7 @@ def encrypt( 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._encrypt_serialize( project_id=project_id, @@ -3108,7 +3108,7 @@ def encrypt_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._encrypt_serialize( project_id=project_id, @@ -3193,7 +3193,7 @@ def encrypt_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._encrypt_serialize( project_id=project_id, @@ -3241,7 +3241,7 @@ def _encrypt_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 @@ -3341,7 +3341,7 @@ def get_key( 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_key_serialize( project_id=project_id, @@ -3417,7 +3417,7 @@ def get_key_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_key_serialize( project_id=project_id, @@ -3493,7 +3493,7 @@ def get_key_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_key_serialize( project_id=project_id, @@ -3536,7 +3536,7 @@ def _get_key_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 @@ -3621,7 +3621,7 @@ def get_key_ring( 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_key_ring_serialize( project_id=project_id, @@ -3693,7 +3693,7 @@ def get_key_ring_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_key_ring_serialize( project_id=project_id, @@ -3765,7 +3765,7 @@ def get_key_ring_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_key_ring_serialize( project_id=project_id, @@ -3806,7 +3806,7 @@ def _get_key_ring_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 @@ -3895,7 +3895,7 @@ def get_version( 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_version_serialize( project_id=project_id, @@ -3975,7 +3975,7 @@ def get_version_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_version_serialize( project_id=project_id, @@ -4055,7 +4055,7 @@ def get_version_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_version_serialize( project_id=project_id, @@ -4100,7 +4100,7 @@ def _get_version_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 @@ -4190,7 +4190,7 @@ def get_wrapping_key( 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_wrapping_key_serialize( project_id=project_id, @@ -4266,7 +4266,7 @@ def get_wrapping_key_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_wrapping_key_serialize( project_id=project_id, @@ -4342,7 +4342,7 @@ def get_wrapping_key_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_wrapping_key_serialize( project_id=project_id, @@ -4385,7 +4385,7 @@ def _get_wrapping_key_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 @@ -4476,7 +4476,7 @@ def import_key( 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._import_key_serialize( project_id=project_id, @@ -4557,7 +4557,7 @@ def import_key_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._import_key_serialize( project_id=project_id, @@ -4638,7 +4638,7 @@ def import_key_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._import_key_serialize( project_id=project_id, @@ -4684,7 +4684,7 @@ def _import_key_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 @@ -4776,7 +4776,7 @@ def list_key_rings( 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_key_rings_serialize( project_id=project_id, @@ -4843,7 +4843,7 @@ def list_key_rings_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_key_rings_serialize( project_id=project_id, @@ -4910,7 +4910,7 @@ def list_key_rings_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_key_rings_serialize( project_id=project_id, @@ -4948,7 +4948,7 @@ def _list_key_rings_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 @@ -5029,7 +5029,7 @@ def list_keys( 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_keys_serialize( project_id=project_id, @@ -5101,7 +5101,7 @@ def list_keys_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_keys_serialize( project_id=project_id, @@ -5173,7 +5173,7 @@ def list_keys_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_keys_serialize( project_id=project_id, @@ -5214,7 +5214,7 @@ def _list_keys_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 @@ -5300,7 +5300,7 @@ def list_versions( 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_versions_serialize( project_id=project_id, @@ -5376,7 +5376,7 @@ def list_versions_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_versions_serialize( project_id=project_id, @@ -5452,7 +5452,7 @@ def list_versions_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_versions_serialize( project_id=project_id, @@ -5495,7 +5495,7 @@ def _list_versions_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 @@ -5580,7 +5580,7 @@ def list_wrapping_keys( 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_wrapping_keys_serialize( project_id=project_id, @@ -5652,7 +5652,7 @@ def list_wrapping_keys_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_wrapping_keys_serialize( project_id=project_id, @@ -5724,7 +5724,7 @@ def list_wrapping_keys_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_wrapping_keys_serialize( project_id=project_id, @@ -5765,7 +5765,7 @@ def _list_wrapping_keys_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 @@ -5851,7 +5851,7 @@ def restore_key( 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._restore_key_serialize( project_id=project_id, @@ -5927,7 +5927,7 @@ def restore_key_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._restore_key_serialize( project_id=project_id, @@ -6003,7 +6003,7 @@ def restore_key_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._restore_key_serialize( project_id=project_id, @@ -6046,7 +6046,7 @@ def _restore_key_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 @@ -6137,7 +6137,7 @@ def restore_version( 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._restore_version_serialize( project_id=project_id, @@ -6217,7 +6217,7 @@ def restore_version_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._restore_version_serialize( project_id=project_id, @@ -6297,7 +6297,7 @@ def restore_version_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._restore_version_serialize( project_id=project_id, @@ -6342,7 +6342,7 @@ def _restore_version_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 @@ -6432,7 +6432,7 @@ def rotate_key( 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._rotate_key_serialize( project_id=project_id, @@ -6510,7 +6510,7 @@ def rotate_key_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._rotate_key_serialize( project_id=project_id, @@ -6588,7 +6588,7 @@ def rotate_key_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._rotate_key_serialize( project_id=project_id, @@ -6633,7 +6633,7 @@ def _rotate_key_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 @@ -6727,7 +6727,7 @@ def sign( 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._sign_serialize( project_id=project_id, @@ -6812,7 +6812,7 @@ def sign_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._sign_serialize( project_id=project_id, @@ -6897,7 +6897,7 @@ def sign_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._sign_serialize( project_id=project_id, @@ -6945,7 +6945,7 @@ def _sign_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 @@ -7051,7 +7051,7 @@ def verify( 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._verify_serialize( project_id=project_id, @@ -7136,7 +7136,7 @@ def verify_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._verify_serialize( project_id=project_id, @@ -7221,7 +7221,7 @@ def verify_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._verify_serialize( project_id=project_id, @@ -7269,7 +7269,7 @@ def _verify_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/kms/src/stackit/kms/api_client.py b/services/kms/src/stackit/kms/api_client.py index 21fe5b5a..b6026d0d 100644 --- a/services/kms/src/stackit/kms/api_client.py +++ b/services/kms/src/stackit/kms/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/kms/src/stackit/kms/configuration.py b/services/kms/src/stackit/kms/configuration.py index 0c81b320..af52a98d 100644 --- a/services/kms/src/stackit/kms/configuration.py +++ b/services/kms/src/stackit/kms/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Key Management Service 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/kms/src/stackit/kms/exceptions.py b/services/kms/src/stackit/kms/exceptions.py index 7e9a4dd3..917e4063 100644 --- a/services/kms/src/stackit/kms/exceptions.py +++ b/services/kms/src/stackit/kms/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/kms/src/stackit/kms/models/__init__.py b/services/kms/src/stackit/kms/models/__init__.py index 0174b5aa..51cb19d3 100644 --- a/services/kms/src/stackit/kms/models/__init__.py +++ b/services/kms/src/stackit/kms/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/kms/src/stackit/kms/models/algorithm.py b/services/kms/src/stackit/kms/models/algorithm.py index e4900daf..bddc6487 100644 --- a/services/kms/src/stackit/kms/models/algorithm.py +++ b/services/kms/src/stackit/kms/models/algorithm.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/kms/src/stackit/kms/models/backend.py b/services/kms/src/stackit/kms/models/backend.py index 9e2117e3..43d5759d 100644 --- a/services/kms/src/stackit/kms/models/backend.py +++ b/services/kms/src/stackit/kms/models/backend.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/kms/src/stackit/kms/models/create_key_payload.py b/services/kms/src/stackit/kms/models/create_key_payload.py index d43a89e4..cf9ddbe9 100644 --- a/services/kms/src/stackit/kms/models/create_key_payload.py +++ b/services/kms/src/stackit/kms/models/create_key_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 @@ -28,7 +28,7 @@ class CreateKeyPayload(BaseModel): """ CreateKeyPayload - """ + """ # noqa: E501 algorithm: Algorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/create_key_ring_payload.py b/services/kms/src/stackit/kms/models/create_key_ring_payload.py index 943dfc02..c6d21765 100644 --- a/services/kms/src/stackit/kms/models/create_key_ring_payload.py +++ b/services/kms/src/stackit/kms/models/create_key_ring_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 CreateKeyRingPayload(BaseModel): """ CreateKeyRingPayload - """ + """ # noqa: E501 description: Optional[StrictStr] = Field( default=None, description="A user chosen description to distinguish multiple key rings." diff --git a/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py b/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py index b454775a..ef958d80 100644 --- a/services/kms/src/stackit/kms/models/create_wrapping_key_payload.py +++ b/services/kms/src/stackit/kms/models/create_wrapping_key_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 @@ -28,7 +28,7 @@ class CreateWrappingKeyPayload(BaseModel): """ CreateWrappingKeyPayload - """ + """ # noqa: E501 algorithm: WrappingAlgorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/decrypt_payload.py b/services/kms/src/stackit/kms/models/decrypt_payload.py index 456205a6..b384dbbb 100644 --- a/services/kms/src/stackit/kms/models/decrypt_payload.py +++ b/services/kms/src/stackit/kms/models/decrypt_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 DecryptPayload(BaseModel): """ DecryptPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that has to be decrypted. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/decrypted_data.py b/services/kms/src/stackit/kms/models/decrypted_data.py index 3956ae77..6e7c52ab 100644 --- a/services/kms/src/stackit/kms/models/decrypted_data.py +++ b/services/kms/src/stackit/kms/models/decrypted_data.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 DecryptedData(BaseModel): """ DecryptedData - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The decrypted data. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/encrypt_payload.py b/services/kms/src/stackit/kms/models/encrypt_payload.py index 38aa91de..c1bdf32e 100644 --- a/services/kms/src/stackit/kms/models/encrypt_payload.py +++ b/services/kms/src/stackit/kms/models/encrypt_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 EncryptPayload(BaseModel): """ EncryptPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that has to be encrypted. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/encrypted_data.py b/services/kms/src/stackit/kms/models/encrypted_data.py index 07ec43e2..df0bb457 100644 --- a/services/kms/src/stackit/kms/models/encrypted_data.py +++ b/services/kms/src/stackit/kms/models/encrypted_data.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 EncryptedData(BaseModel): """ EncryptedData - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The encrypted data. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/http_error.py b/services/kms/src/stackit/kms/models/http_error.py index 491c52dc..51793d12 100644 --- a/services/kms/src/stackit/kms/models/http_error.py +++ b/services/kms/src/stackit/kms/models/http_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 HttpError(BaseModel): """ HttpError - """ + """ # noqa: E501 message: StrictStr = Field(description="A string that gives a short information about what went wrong.") __properties: ClassVar[List[str]] = ["message"] diff --git a/services/kms/src/stackit/kms/models/import_key_payload.py b/services/kms/src/stackit/kms/models/import_key_payload.py index 81dbd60c..aa494167 100644 --- a/services/kms/src/stackit/kms/models/import_key_payload.py +++ b/services/kms/src/stackit/kms/models/import_key_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 ImportKeyPayload(BaseModel): """ ImportKeyPayload - """ + """ # noqa: E501 wrapped_key: StrictStr = Field( description="The wrapped key material that has to be imported. Encoded in base64.", alias="wrappedKey" diff --git a/services/kms/src/stackit/kms/models/key.py b/services/kms/src/stackit/kms/models/key.py index b28e5f13..70e6614d 100644 --- a/services/kms/src/stackit/kms/models/key.py +++ b/services/kms/src/stackit/kms/models/key.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 @@ -36,7 +36,7 @@ class Key(BaseModel): """ Key - """ + """ # noqa: E501 algorithm: Algorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/key_list.py b/services/kms/src/stackit/kms/models/key_list.py index 094ffd9e..28d0af58 100644 --- a/services/kms/src/stackit/kms/models/key_list.py +++ b/services/kms/src/stackit/kms/models/key_list.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 KeyList(BaseModel): """ KeyList - """ + """ # noqa: E501 keys: List[Key] __properties: ClassVar[List[str]] = ["keys"] diff --git a/services/kms/src/stackit/kms/models/key_ring.py b/services/kms/src/stackit/kms/models/key_ring.py index 3c2753c7..53aa446d 100644 --- a/services/kms/src/stackit/kms/models/key_ring.py +++ b/services/kms/src/stackit/kms/models/key_ring.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 KeyRing(BaseModel): """ KeyRing - """ + """ # noqa: E501 created_at: datetime = Field( description="The date and time the creation of the key ring was triggered.", alias="createdAt" diff --git a/services/kms/src/stackit/kms/models/key_ring_list.py b/services/kms/src/stackit/kms/models/key_ring_list.py index 854e24b0..3dc1bafc 100644 --- a/services/kms/src/stackit/kms/models/key_ring_list.py +++ b/services/kms/src/stackit/kms/models/key_ring_list.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 KeyRingList(BaseModel): """ KeyRingList - """ + """ # noqa: E501 key_rings: List[KeyRing] = Field(alias="keyRings") __properties: ClassVar[List[str]] = ["keyRings"] diff --git a/services/kms/src/stackit/kms/models/purpose.py b/services/kms/src/stackit/kms/models/purpose.py index c884ab13..5a36fcac 100644 --- a/services/kms/src/stackit/kms/models/purpose.py +++ b/services/kms/src/stackit/kms/models/purpose.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/kms/src/stackit/kms/models/sign_payload.py b/services/kms/src/stackit/kms/models/sign_payload.py index f1d49d0a..8f30b3e1 100644 --- a/services/kms/src/stackit/kms/models/sign_payload.py +++ b/services/kms/src/stackit/kms/models/sign_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 SignPayload(BaseModel): """ SignPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that has to be signed. Encoded in base64.") __properties: ClassVar[List[str]] = ["data"] diff --git a/services/kms/src/stackit/kms/models/signed_data.py b/services/kms/src/stackit/kms/models/signed_data.py index 45f67aad..fb7ea875 100644 --- a/services/kms/src/stackit/kms/models/signed_data.py +++ b/services/kms/src/stackit/kms/models/signed_data.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 SignedData(BaseModel): """ SignedData - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data that was signed. Encoded in base64.") signature: Union[StrictBytes, StrictStr] = Field(description="The signature of the data. Encoded in base64.") diff --git a/services/kms/src/stackit/kms/models/verified_data.py b/services/kms/src/stackit/kms/models/verified_data.py index a28daa78..23d86c4b 100644 --- a/services/kms/src/stackit/kms/models/verified_data.py +++ b/services/kms/src/stackit/kms/models/verified_data.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 VerifiedData(BaseModel): """ VerifiedData - """ + """ # noqa: E501 valid: StrictBool = Field(description="Whether or not the data has a valid signature.") __properties: ClassVar[List[str]] = ["valid"] diff --git a/services/kms/src/stackit/kms/models/verify_payload.py b/services/kms/src/stackit/kms/models/verify_payload.py index 08b63d62..46462bc7 100644 --- a/services/kms/src/stackit/kms/models/verify_payload.py +++ b/services/kms/src/stackit/kms/models/verify_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 VerifyPayload(BaseModel): """ VerifyPayload - """ + """ # noqa: E501 data: Union[StrictBytes, StrictStr] = Field(description="The data to be verified. Encoded in base64.") signature: Union[StrictBytes, StrictStr] = Field(description="The signature of the data. Encoded in base64.") diff --git a/services/kms/src/stackit/kms/models/version.py b/services/kms/src/stackit/kms/models/version.py index cfc63b0b..17fefb9d 100644 --- a/services/kms/src/stackit/kms/models/version.py +++ b/services/kms/src/stackit/kms/models/version.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 @@ -33,7 +33,7 @@ class Version(BaseModel): """ Version - """ + """ # noqa: E501 created_at: datetime = Field( description="The date and time the creation of the key was triggered.", alias="createdAt" diff --git a/services/kms/src/stackit/kms/models/version_list.py b/services/kms/src/stackit/kms/models/version_list.py index 2c38db76..07f41aad 100644 --- a/services/kms/src/stackit/kms/models/version_list.py +++ b/services/kms/src/stackit/kms/models/version_list.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 VersionList(BaseModel): """ VersionList - """ + """ # noqa: E501 versions: List[Version] __properties: ClassVar[List[str]] = ["versions"] diff --git a/services/kms/src/stackit/kms/models/wrapping_algorithm.py b/services/kms/src/stackit/kms/models/wrapping_algorithm.py index e2581909..e2c55e60 100644 --- a/services/kms/src/stackit/kms/models/wrapping_algorithm.py +++ b/services/kms/src/stackit/kms/models/wrapping_algorithm.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/kms/src/stackit/kms/models/wrapping_key.py b/services/kms/src/stackit/kms/models/wrapping_key.py index 10de3114..17e5bb36 100644 --- a/services/kms/src/stackit/kms/models/wrapping_key.py +++ b/services/kms/src/stackit/kms/models/wrapping_key.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 WrappingKey(BaseModel): """ WrappingKey - """ + """ # noqa: E501 algorithm: WrappingAlgorithm backend: Backend diff --git a/services/kms/src/stackit/kms/models/wrapping_key_list.py b/services/kms/src/stackit/kms/models/wrapping_key_list.py index 43c4068f..d0ef2e0f 100644 --- a/services/kms/src/stackit/kms/models/wrapping_key_list.py +++ b/services/kms/src/stackit/kms/models/wrapping_key_list.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 WrappingKeyList(BaseModel): """ WrappingKeyList - """ + """ # noqa: E501 wrapping_keys: List[WrappingKey] = Field(alias="wrappingKeys") __properties: ClassVar[List[str]] = ["wrappingKeys"] diff --git a/services/kms/src/stackit/kms/models/wrapping_purpose.py b/services/kms/src/stackit/kms/models/wrapping_purpose.py index 3165f82b..0d0a6e8d 100644 --- a/services/kms/src/stackit/kms/models/wrapping_purpose.py +++ b/services/kms/src/stackit/kms/models/wrapping_purpose.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/kms/src/stackit/kms/rest.py b/services/kms/src/stackit/kms/rest.py index c9b3a128..db6b5cff 100644 --- a/services/kms/src/stackit/kms/rest.py +++ b/services/kms/src/stackit/kms/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: