diff --git a/services/serverbackup/src/stackit/serverbackup/__init__.py b/services/serverbackup/src/stackit/serverbackup/__init__.py index 63eaf90e..d4f9c71d 100644 --- a/services/serverbackup/src/stackit/serverbackup/__init__.py +++ b/services/serverbackup/src/stackit/serverbackup/__init__.py @@ -12,61 +12,99 @@ 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", + "Backup", + "BackupJob", + "BackupPolicy", + "BackupPolicyBackupProperties", + "BackupProperties", + "BackupSchedule", + "BackupVolumeBackupsInner", + "CreateBackupPayload", + "CreateBackupSchedulePayload", + "EnableServiceResourcePayload", + "ErrorResponse", + "GetBackupPoliciesResponse", + "GetBackupSchedulesResponse", + "GetBackupServiceResponse", + "GetBackupsListResponse", + "RestoreBackupPayload", + "RestoreVolumeBackupPayload", + "UpdateBackupSchedulePayload", +] + # import apis into sdk package -from stackit.serverbackup.api.default_api import DefaultApi -from stackit.serverbackup.api_client import ApiClient +from stackit.serverbackup.api.default_api import DefaultApi as DefaultApi +from stackit.serverbackup.api_client import ApiClient as ApiClient # import ApiClient -from stackit.serverbackup.api_response import ApiResponse -from stackit.serverbackup.configuration import HostConfiguration -from stackit.serverbackup.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.serverbackup.api_response import ApiResponse as ApiResponse +from stackit.serverbackup.configuration import HostConfiguration as HostConfiguration +from stackit.serverbackup.exceptions import ApiAttributeError as ApiAttributeError +from stackit.serverbackup.exceptions import ApiException as ApiException +from stackit.serverbackup.exceptions import ApiKeyError as ApiKeyError +from stackit.serverbackup.exceptions import ApiTypeError as ApiTypeError +from stackit.serverbackup.exceptions import ApiValueError as ApiValueError +from stackit.serverbackup.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.serverbackup.models.backup import Backup -from stackit.serverbackup.models.backup_job import BackupJob -from stackit.serverbackup.models.backup_policy import BackupPolicy +from stackit.serverbackup.models.backup import Backup as Backup +from stackit.serverbackup.models.backup_job import BackupJob as BackupJob +from stackit.serverbackup.models.backup_policy import BackupPolicy as BackupPolicy from stackit.serverbackup.models.backup_policy_backup_properties import ( - BackupPolicyBackupProperties, + BackupPolicyBackupProperties as BackupPolicyBackupProperties, +) +from stackit.serverbackup.models.backup_properties import ( + BackupProperties as BackupProperties, ) -from stackit.serverbackup.models.backup_properties import BackupProperties -from stackit.serverbackup.models.backup_schedule import BackupSchedule +from stackit.serverbackup.models.backup_schedule import BackupSchedule as BackupSchedule from stackit.serverbackup.models.backup_volume_backups_inner import ( - BackupVolumeBackupsInner, + BackupVolumeBackupsInner as BackupVolumeBackupsInner, +) +from stackit.serverbackup.models.create_backup_payload import ( + CreateBackupPayload as CreateBackupPayload, ) -from stackit.serverbackup.models.create_backup_payload import CreateBackupPayload from stackit.serverbackup.models.create_backup_schedule_payload import ( - CreateBackupSchedulePayload, + CreateBackupSchedulePayload as CreateBackupSchedulePayload, ) from stackit.serverbackup.models.enable_service_resource_payload import ( - EnableServiceResourcePayload, + EnableServiceResourcePayload as EnableServiceResourcePayload, ) -from stackit.serverbackup.models.error_response import ErrorResponse +from stackit.serverbackup.models.error_response import ErrorResponse as ErrorResponse from stackit.serverbackup.models.get_backup_policies_response import ( - GetBackupPoliciesResponse, + GetBackupPoliciesResponse as GetBackupPoliciesResponse, ) from stackit.serverbackup.models.get_backup_schedules_response import ( - GetBackupSchedulesResponse, + GetBackupSchedulesResponse as GetBackupSchedulesResponse, ) from stackit.serverbackup.models.get_backup_service_response import ( - GetBackupServiceResponse, + GetBackupServiceResponse as GetBackupServiceResponse, +) +from stackit.serverbackup.models.get_backups_list_response import ( + GetBackupsListResponse as GetBackupsListResponse, +) +from stackit.serverbackup.models.restore_backup_payload import ( + RestoreBackupPayload as RestoreBackupPayload, ) -from stackit.serverbackup.models.get_backups_list_response import GetBackupsListResponse -from stackit.serverbackup.models.restore_backup_payload import RestoreBackupPayload from stackit.serverbackup.models.restore_volume_backup_payload import ( - RestoreVolumeBackupPayload, + RestoreVolumeBackupPayload as RestoreVolumeBackupPayload, ) from stackit.serverbackup.models.update_backup_schedule_payload import ( - UpdateBackupSchedulePayload, + UpdateBackupSchedulePayload as UpdateBackupSchedulePayload, ) diff --git a/services/serverbackup/src/stackit/serverbackup/api/default_api.py b/services/serverbackup/src/stackit/serverbackup/api/default_api.py index 0926df38..b3ace499 100644 --- a/services/serverbackup/src/stackit/serverbackup/api/default_api.py +++ b/services/serverbackup/src/stackit/serverbackup/api/default_api.py @@ -10,11 +10,11 @@ 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 -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call from stackit.core.configuration import Configuration from typing_extensions import Annotated @@ -111,7 +111,7 @@ def create_backup( 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_backup_serialize( project_id=project_id, @@ -186,7 +186,7 @@ def create_backup_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_backup_serialize( project_id=project_id, @@ -261,7 +261,7 @@ def create_backup_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_backup_serialize( project_id=project_id, @@ -304,7 +304,7 @@ def _create_backup_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 @@ -399,7 +399,7 @@ def create_backup_schedule( 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_backup_schedule_serialize( project_id=project_id, @@ -473,7 +473,7 @@ def create_backup_schedule_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_backup_schedule_serialize( project_id=project_id, @@ -547,7 +547,7 @@ def create_backup_schedule_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_backup_schedule_serialize( project_id=project_id, @@ -589,7 +589,7 @@ def _create_backup_schedule_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 @@ -643,6 +643,7 @@ def delete_backup( server_id: Annotated[StrictStr, Field(description="server id")], region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], + force: Annotated[Optional[StrictBool], Field(description="force delete the backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -664,6 +665,8 @@ def delete_backup( :type region: str :param backup_id: id of the backup (required) :type backup_id: str + :param force: force delete the backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -684,13 +687,14 @@ def delete_backup( 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_backup_serialize( project_id=project_id, server_id=server_id, region=region, backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -717,6 +721,7 @@ def delete_backup_with_http_info( server_id: Annotated[StrictStr, Field(description="server id")], region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], + force: Annotated[Optional[StrictBool], Field(description="force delete the backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -738,6 +743,8 @@ def delete_backup_with_http_info( :type region: str :param backup_id: id of the backup (required) :type backup_id: str + :param force: force delete the backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -758,13 +765,14 @@ def delete_backup_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_backup_serialize( project_id=project_id, server_id=server_id, region=region, backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -791,6 +799,7 @@ def delete_backup_without_preload_content( server_id: Annotated[StrictStr, Field(description="server id")], region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], + force: Annotated[Optional[StrictBool], Field(description="force delete the backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -812,6 +821,8 @@ def delete_backup_without_preload_content( :type region: str :param backup_id: id of the backup (required) :type backup_id: str + :param force: force delete the backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -832,13 +843,14 @@ def delete_backup_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_backup_serialize( project_id=project_id, server_id=server_id, region=region, backup_id=backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -860,6 +872,7 @@ def _delete_backup_serialize( server_id, region, backup_id, + force, _request_auth, _content_type, _headers, @@ -874,7 +887,7 @@ def _delete_backup_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 @@ -887,6 +900,10 @@ def _delete_backup_serialize( if backup_id is not None: _path_params["backupId"] = backup_id # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + # process the header parameters # process the form parameters # process the body parameter @@ -961,7 +978,7 @@ def delete_backup_schedule( 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_backup_schedule_serialize( project_id=project_id, @@ -1035,7 +1052,7 @@ def delete_backup_schedule_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_backup_schedule_serialize( project_id=project_id, @@ -1109,7 +1126,7 @@ def delete_backup_schedule_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_backup_schedule_serialize( project_id=project_id, @@ -1151,7 +1168,7 @@ def _delete_backup_schedule_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 @@ -1198,6 +1215,7 @@ def delete_volume_backup( region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], volume_backup_id: Annotated[StrictStr, Field(description="id of the volume backup")], + force: Annotated[Optional[StrictBool], Field(description="Force delete the volume backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1221,6 +1239,8 @@ def delete_volume_backup( :type backup_id: str :param volume_backup_id: id of the volume backup (required) :type volume_backup_id: str + :param force: Force delete the volume backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1241,7 +1261,7 @@ def delete_volume_backup( 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_volume_backup_serialize( project_id=project_id, @@ -1249,6 +1269,7 @@ def delete_volume_backup( region=region, backup_id=backup_id, volume_backup_id=volume_backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1276,6 +1297,7 @@ def delete_volume_backup_with_http_info( region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], volume_backup_id: Annotated[StrictStr, Field(description="id of the volume backup")], + force: Annotated[Optional[StrictBool], Field(description="Force delete the volume backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1299,6 +1321,8 @@ def delete_volume_backup_with_http_info( :type backup_id: str :param volume_backup_id: id of the volume backup (required) :type volume_backup_id: str + :param force: Force delete the volume backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1319,7 +1343,7 @@ def delete_volume_backup_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_volume_backup_serialize( project_id=project_id, @@ -1327,6 +1351,7 @@ def delete_volume_backup_with_http_info( region=region, backup_id=backup_id, volume_backup_id=volume_backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1354,6 +1379,7 @@ def delete_volume_backup_without_preload_content( region: Annotated[StrictStr, Field(description="region")], backup_id: Annotated[StrictStr, Field(description="id of the backup")], volume_backup_id: Annotated[StrictStr, Field(description="id of the volume backup")], + force: Annotated[Optional[StrictBool], Field(description="Force delete the volume backup")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1377,6 +1403,8 @@ def delete_volume_backup_without_preload_content( :type backup_id: str :param volume_backup_id: id of the volume backup (required) :type volume_backup_id: str + :param force: Force delete the volume backup + :type force: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1397,7 +1425,7 @@ def delete_volume_backup_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_volume_backup_serialize( project_id=project_id, @@ -1405,6 +1433,7 @@ def delete_volume_backup_without_preload_content( region=region, backup_id=backup_id, volume_backup_id=volume_backup_id, + force=force, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1427,6 +1456,7 @@ def _delete_volume_backup_serialize( region, backup_id, volume_backup_id, + force, _request_auth, _content_type, _headers, @@ -1441,7 +1471,7 @@ def _delete_volume_backup_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 @@ -1456,6 +1486,10 @@ def _delete_volume_backup_serialize( if volume_backup_id is not None: _path_params["volumeBackupId"] = volume_backup_id # process the query parameters + if force is not None: + + _query_params.append(("force", force)) + # process the header parameters # process the form parameters # process the body parameter @@ -1527,7 +1561,7 @@ def disable_service_resource( 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_resource_serialize( project_id=project_id, @@ -1597,7 +1631,7 @@ def disable_service_resource_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_resource_serialize( project_id=project_id, @@ -1667,7 +1701,7 @@ def disable_service_resource_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_resource_serialize( project_id=project_id, @@ -1707,7 +1741,7 @@ def _disable_service_resource_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 @@ -1792,7 +1826,7 @@ def enable_service_resource( 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_resource_serialize( project_id=project_id, @@ -1866,7 +1900,7 @@ def enable_service_resource_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_resource_serialize( project_id=project_id, @@ -1940,7 +1974,7 @@ def enable_service_resource_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_resource_serialize( project_id=project_id, @@ -1982,7 +2016,7 @@ def _enable_service_resource_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 @@ -2077,7 +2111,7 @@ def get_backup( 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_backup_serialize( project_id=project_id, @@ -2151,7 +2185,7 @@ def get_backup_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_backup_serialize( project_id=project_id, @@ -2225,7 +2259,7 @@ def get_backup_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_backup_serialize( project_id=project_id, @@ -2267,7 +2301,7 @@ def _get_backup_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 @@ -2354,7 +2388,7 @@ def get_backup_schedule( 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_backup_schedule_serialize( project_id=project_id, @@ -2428,7 +2462,7 @@ def get_backup_schedule_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_backup_schedule_serialize( project_id=project_id, @@ -2502,7 +2536,7 @@ def get_backup_schedule_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_backup_schedule_serialize( project_id=project_id, @@ -2544,7 +2578,7 @@ def _get_backup_schedule_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 @@ -2628,7 +2662,7 @@ def get_service_resource( 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_resource_serialize( project_id=project_id, @@ -2698,7 +2732,7 @@ def get_service_resource_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_resource_serialize( project_id=project_id, @@ -2768,7 +2802,7 @@ def get_service_resource_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_resource_serialize( project_id=project_id, @@ -2808,7 +2842,7 @@ def _get_service_resource_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 @@ -2884,7 +2918,7 @@ def list_backup_policies( 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_backup_policies_serialize( project_id=project_id, @@ -2946,7 +2980,7 @@ def list_backup_policies_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_backup_policies_serialize( project_id=project_id, @@ -3008,7 +3042,7 @@ def list_backup_policies_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_backup_policies_serialize( project_id=project_id, @@ -3044,7 +3078,7 @@ def _list_backup_policies_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 @@ -3122,7 +3156,7 @@ def list_backup_schedules( 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_backup_schedules_serialize( project_id=project_id, @@ -3192,7 +3226,7 @@ def list_backup_schedules_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_backup_schedules_serialize( project_id=project_id, @@ -3262,7 +3296,7 @@ def list_backup_schedules_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_backup_schedules_serialize( project_id=project_id, @@ -3302,7 +3336,7 @@ def _list_backup_schedules_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 @@ -3384,7 +3418,7 @@ def list_backups( 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_backups_serialize( project_id=project_id, @@ -3454,7 +3488,7 @@ def list_backups_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_backups_serialize( project_id=project_id, @@ -3524,7 +3558,7 @@ def list_backups_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_backups_serialize( project_id=project_id, @@ -3564,7 +3598,7 @@ def _list_backups_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 @@ -3652,7 +3686,7 @@ def restore_backup( 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_backup_serialize( project_id=project_id, @@ -3731,7 +3765,7 @@ def restore_backup_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_backup_serialize( project_id=project_id, @@ -3810,7 +3844,7 @@ def restore_backup_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_backup_serialize( project_id=project_id, @@ -3855,7 +3889,7 @@ def _restore_backup_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 @@ -3958,7 +3992,7 @@ def restore_volume_backup( 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_volume_backup_serialize( project_id=project_id, @@ -4040,7 +4074,7 @@ def restore_volume_backup_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_volume_backup_serialize( project_id=project_id, @@ -4122,7 +4156,7 @@ def restore_volume_backup_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_volume_backup_serialize( project_id=project_id, @@ -4168,7 +4202,7 @@ def _restore_volume_backup_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 @@ -4270,7 +4304,7 @@ def update_backup_schedule( 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._update_backup_schedule_serialize( project_id=project_id, @@ -4348,7 +4382,7 @@ def update_backup_schedule_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._update_backup_schedule_serialize( project_id=project_id, @@ -4426,7 +4460,7 @@ def update_backup_schedule_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._update_backup_schedule_serialize( project_id=project_id, @@ -4470,7 +4504,7 @@ def _update_backup_schedule_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/serverbackup/src/stackit/serverbackup/api_client.py b/services/serverbackup/src/stackit/serverbackup/api_client.py index d90bf75c..0c8ec97f 100644 --- a/services/serverbackup/src/stackit/serverbackup/api_client.py +++ b/services/serverbackup/src/stackit/serverbackup/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/serverbackup/src/stackit/serverbackup/configuration.py b/services/serverbackup/src/stackit/serverbackup/configuration.py index 06e2482a..ee879015 100644 --- a/services/serverbackup/src/stackit/serverbackup/configuration.py +++ b/services/serverbackup/src/stackit/serverbackup/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Server Backup Management 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/serverbackup/src/stackit/serverbackup/exceptions.py b/services/serverbackup/src/stackit/serverbackup/exceptions.py index 0591a4ae..88b8b19f 100644 --- a/services/serverbackup/src/stackit/serverbackup/exceptions.py +++ b/services/serverbackup/src/stackit/serverbackup/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/serverbackup/src/stackit/serverbackup/models/__init__.py b/services/serverbackup/src/stackit/serverbackup/models/__init__.py index 30416d5a..312a47fd 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/__init__.py +++ b/services/serverbackup/src/stackit/serverbackup/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/serverbackup/src/stackit/serverbackup/models/backup.py b/services/serverbackup/src/stackit/serverbackup/models/backup.py index 787eaff1..3ef572f1 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup.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 @@ -29,7 +29,7 @@ class Backup(BaseModel): """ Backup - """ + """ # noqa: E501 created_at: StrictStr = Field(alias="createdAt") expire_at: StrictStr = Field(alias="expireAt") diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_job.py b/services/serverbackup/src/stackit/serverbackup/models/backup_job.py index 6b00e2b9..8ac51628 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_job.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_job.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 BackupJob(BaseModel): """ BackupJob - """ + """ # noqa: E501 id: StrictStr __properties: ClassVar[List[str]] = ["id"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py b/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py index 57858e2f..412ae3d8 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_policy.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_policy.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 @@ -29,7 +29,7 @@ class BackupPolicy(BaseModel): """ BackupPolicy - """ + """ # noqa: E501 backup_properties: Optional[BackupPolicyBackupProperties] = Field(default=None, alias="backupProperties") default: Optional[StrictBool] = None diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py b/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py index 0963c3db..21c0dcfe 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_properties.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_policy_backup_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 @@ -25,7 +25,7 @@ class BackupPolicyBackupProperties(BaseModel): """ BackupPolicyBackupProperties - """ + """ # noqa: E501 name: Optional[StrictStr] = None retention_period: Optional[StrictInt] = Field(default=None, alias="retentionPeriod") diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py b/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py index 5ebf9176..7938cf28 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_properties.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_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 @@ -25,7 +25,7 @@ class BackupProperties(BaseModel): """ BackupProperties - """ + """ # noqa: E501 name: StrictStr = Field(description="Max 255 characters") retention_period: Annotated[int, Field(le=36500, strict=True, ge=1)] = Field( diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py b/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py index 0159ea91..6da5d260 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_schedule.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 BackupSchedule(BaseModel): """ BackupSchedule - """ + """ # noqa: E501 backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties") enabled: StrictBool diff --git a/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py b/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py index 3d1d7f33..aa5d2211 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.py +++ b/services/serverbackup/src/stackit/serverbackup/models/backup_volume_backups_inner.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 BackupVolumeBackupsInner(BaseModel): """ BackupVolumeBackupsInner - """ + """ # noqa: E501 id: Optional[StrictStr] = None last_restored_at: Optional[StrictStr] = Field(default=None, alias="lastRestoredAt") diff --git a/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py b/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py index abaf5ff7..a47a5eec 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/create_backup_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/create_backup_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 CreateBackupPayload(BaseModel): """ CreateBackupPayload - """ + """ # noqa: E501 name: StrictStr = Field(description="Max 255 characters") retention_period: Annotated[int, Field(le=36500, strict=True, ge=1)] = Field( diff --git a/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py b/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py index 6cccad25..b54241be 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/create_backup_schedule_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 @@ -27,7 +27,7 @@ class CreateBackupSchedulePayload(BaseModel): """ CreateBackupSchedulePayload - """ + """ # noqa: E501 backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties") enabled: StrictBool diff --git a/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py b/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py index 7c9d7146..6e89b7a0 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/enable_service_resource_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 EnableServiceResourcePayload(BaseModel): """ EnableServiceResourcePayload - """ + """ # noqa: E501 backup_policy_id: Optional[StrictStr] = Field(default=None, alias="backupPolicyId") __properties: ClassVar[List[str]] = ["backupPolicyId"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/error_response.py b/services/serverbackup/src/stackit/serverbackup/models/error_response.py index fc17208b..e7d73adb 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/error_response.py +++ b/services/serverbackup/src/stackit/serverbackup/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/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py index 01bff28a..76460f0f 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backup_policies_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 GetBackupPoliciesResponse(BaseModel): """ GetBackupPoliciesResponse - """ + """ # noqa: E501 items: Optional[List[BackupPolicy]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py index d2b6c0d4..fab99212 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backup_schedules_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 GetBackupSchedulesResponse(BaseModel): """ GetBackupSchedulesResponse - """ + """ # noqa: E501 items: Optional[List[BackupSchedule]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py index 3a80fa1d..dec3e28f 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backup_service_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 GetBackupServiceResponse(BaseModel): """ GetBackupServiceResponse - """ + """ # noqa: E501 enabled: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["enabled"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py b/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py index e98e5def..421e4ccf 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_response.py +++ b/services/serverbackup/src/stackit/serverbackup/models/get_backups_list_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 GetBackupsListResponse(BaseModel): """ GetBackupsListResponse - """ + """ # noqa: E501 items: Optional[List[Backup]] = None __properties: ClassVar[List[str]] = ["items"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py b/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py index 9b5dbce2..84e24aac 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/restore_backup_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/restore_backup_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 RestoreBackupPayload(BaseModel): """ RestoreBackupPayload - """ + """ # noqa: E501 start_server_after_restore: StrictBool = Field(alias="startServerAfterRestore") volume_ids: Optional[List[StrictStr]] = Field(default=None, alias="volumeIds") diff --git a/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py b/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py index 0d7ffd77..b5e23e58 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/restore_volume_backup_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 RestoreVolumeBackupPayload(BaseModel): """ RestoreVolumeBackupPayload - """ + """ # noqa: E501 restore_volume_id: StrictStr = Field(alias="restoreVolumeId") __properties: ClassVar[List[str]] = ["restoreVolumeId"] diff --git a/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py b/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py index addfe1fd..737e61d4 100644 --- a/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_payload.py +++ b/services/serverbackup/src/stackit/serverbackup/models/update_backup_schedule_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 @@ -27,7 +27,7 @@ class UpdateBackupSchedulePayload(BaseModel): """ UpdateBackupSchedulePayload - """ + """ # noqa: E501 backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties") enabled: StrictBool diff --git a/services/serverbackup/src/stackit/serverbackup/rest.py b/services/serverbackup/src/stackit/serverbackup/rest.py index d52dfa0f..63a54b1e 100644 --- a/services/serverbackup/src/stackit/serverbackup/rest.py +++ b/services/serverbackup/src/stackit/serverbackup/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: