"""
Cybee API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: 0.42.0
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from datetime import datetime
from pydantic import Field, StrictBool, StrictStr, field_validator
from typing import Any, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from cybee_sdk.api.models.additional_agent_filter import AdditionalAgentFilter
from cybee_sdk.api.models.backup_info import BackupInfo
from cybee_sdk.api.models.file_backup_plan import FileBackupPlan
from cybee_sdk.api.models.file_backup_plan_create import FileBackupPlanCreate
from cybee_sdk.api.models.file_backup_plan_update import FileBackupPlanUpdate
from cybee_sdk.api.models.image_backup_plan import ImageBackupPlan
from cybee_sdk.api.models.image_backup_plan_create import ImageBackupPlanCreate
from cybee_sdk.api.models.image_backup_plan_update import ImageBackupPlanUpdate
from cybee_sdk.api.models.page_backup_plan_error import PageBackupPlanError
from cybee_sdk.api.models.page_backup_plan_run import PageBackupPlanRun
from cybee_sdk.api.models.page_file_backup_plan import PageFileBackupPlan
from cybee_sdk.api.models.page_image_backup_plan import PageImageBackupPlan

from cybee_sdk.api.api_client import ApiClient, RequestSerialized
from cybee_sdk.api.api_response import ApiResponse
from cybee_sdk.api.rest import RESTResponseType


class PlansBackupApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_call
    def assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post(
        self,
        plan_id: UUID,
        agent_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Assign Backup Plan Agent


        :param plan_id: (required)
        :type plan_id: UUID
        :param agent_id: (required)
        :type agent_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post_serialize(
            plan_id=plan_id,
            agent_id=agent_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post_with_http_info(
        self,
        plan_id: UUID,
        agent_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Assign Backup Plan Agent


        :param plan_id: (required)
        :type plan_id: UUID
        :param agent_id: (required)
        :type agent_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post_serialize(
            plan_id=plan_id,
            agent_id=agent_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post_without_preload_content(
        self,
        plan_id: UUID,
        agent_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Assign Backup Plan Agent


        :param plan_id: (required)
        :type plan_id: UUID
        :param agent_id: (required)
        :type agent_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post_serialize(
            plan_id=plan_id,
            agent_id=agent_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _assign_backup_plan_agent_plan_backup_plan_id_assign_agent_agent_id_post_serialize(
        self,
        plan_id,
        agent_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        if agent_id is not None:
            _path_params["agent_id"] = agent_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/{plan_id}/assign-agent/{agent_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post(
        self,
        plan_id: UUID,
        schedule_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Assign Backup Plan Schedule


        :param plan_id: (required)
        :type plan_id: UUID
        :param schedule_id: (required)
        :type schedule_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post_serialize(
            plan_id=plan_id,
            schedule_id=schedule_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post_with_http_info(
        self,
        plan_id: UUID,
        schedule_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Assign Backup Plan Schedule


        :param plan_id: (required)
        :type plan_id: UUID
        :param schedule_id: (required)
        :type schedule_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post_serialize(
            plan_id=plan_id,
            schedule_id=schedule_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post_without_preload_content(
        self,
        plan_id: UUID,
        schedule_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Assign Backup Plan Schedule


        :param plan_id: (required)
        :type plan_id: UUID
        :param schedule_id: (required)
        :type schedule_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post_serialize(
            plan_id=plan_id,
            schedule_id=schedule_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _assign_backup_plan_schedule_plan_backup_plan_id_assign_schedule_schedule_id_post_serialize(
        self,
        plan_id,
        schedule_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        if schedule_id is not None:
            _path_params["schedule_id"] = schedule_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/{plan_id}/assign-schedule/{schedule_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put(
        self,
        backup_plan_run_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Cancel Running Backup Plan


        :param backup_plan_run_id: (required)
        :type backup_plan_run_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put_serialize(
            backup_plan_run_id=backup_plan_run_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put_with_http_info(
        self,
        backup_plan_run_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Cancel Running Backup Plan


        :param backup_plan_run_id: (required)
        :type backup_plan_run_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put_serialize(
            backup_plan_run_id=backup_plan_run_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put_without_preload_content(
        self,
        backup_plan_run_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Cancel Running Backup Plan


        :param backup_plan_run_id: (required)
        :type backup_plan_run_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put_serialize(
            backup_plan_run_id=backup_plan_run_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _cancel_running_backup_plan_plan_backup_run_backup_plan_run_id_cancel_put_serialize(
        self,
        backup_plan_run_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if backup_plan_run_id is not None:
            _path_params["backup_plan_run_id"] = backup_plan_run_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="PUT",
            resource_path="/plan/backup/run/{backup_plan_run_id}/cancel/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def create_file_backup_plans_plan_backup_file_post(
        self,
        file_backup_plan_create: FileBackupPlanCreate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> FileBackupPlan:
        """Create File Backup Plans

        # Create file backup plan  Create a new file backup plan in the backup manager. File plans wrap a complete backup configuration and must declare at least one absolute `config.source_paths` entry.  **Endpoint**: `POST /backup/file/`  **Auth**: requires an authenticated user.  ## Request body (FileBackupPlanCreate) - `name` (string, required): Human-friendly plan name. - `description` (string, optional): Optional free-text description of the plan. - `repo_id` (uuid, required): Target repository id. - `config` (ResticBackup, required): Must include `source_paths` (absolute paths); supports `exclude`, `iexclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, and `global_options.limit_download` / `global_options.limit_upload`. - `schedule_enabled` (bool, default `false`): Whether scheduling is active for this plan. - `schedule_configs` (list of uuid, optional): Scheduling configurations to attach at creation when `schedule_enabled` is true. - `affected_agents` (list of uuid, optional): Agents assigned to this backup plan upon creation. - `retention_settings` (RetentionSettings, optional): Retention policy applied after backup. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Hooks around the backup run. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: `config.source_paths` is mandatory and each path must be absolute. If provided, `pre_script`/`post_script` must include an executor and script path.

        :param file_backup_plan_create: (required)
        :type file_backup_plan_create: FileBackupPlanCreate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_file_backup_plans_plan_backup_file_post_serialize(
            file_backup_plan_create=file_backup_plan_create,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "FileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def create_file_backup_plans_plan_backup_file_post_with_http_info(
        self,
        file_backup_plan_create: FileBackupPlanCreate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[FileBackupPlan]:
        """Create File Backup Plans

        # Create file backup plan  Create a new file backup plan in the backup manager. File plans wrap a complete backup configuration and must declare at least one absolute `config.source_paths` entry.  **Endpoint**: `POST /backup/file/`  **Auth**: requires an authenticated user.  ## Request body (FileBackupPlanCreate) - `name` (string, required): Human-friendly plan name. - `description` (string, optional): Optional free-text description of the plan. - `repo_id` (uuid, required): Target repository id. - `config` (ResticBackup, required): Must include `source_paths` (absolute paths); supports `exclude`, `iexclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, and `global_options.limit_download` / `global_options.limit_upload`. - `schedule_enabled` (bool, default `false`): Whether scheduling is active for this plan. - `schedule_configs` (list of uuid, optional): Scheduling configurations to attach at creation when `schedule_enabled` is true. - `affected_agents` (list of uuid, optional): Agents assigned to this backup plan upon creation. - `retention_settings` (RetentionSettings, optional): Retention policy applied after backup. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Hooks around the backup run. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: `config.source_paths` is mandatory and each path must be absolute. If provided, `pre_script`/`post_script` must include an executor and script path.

        :param file_backup_plan_create: (required)
        :type file_backup_plan_create: FileBackupPlanCreate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_file_backup_plans_plan_backup_file_post_serialize(
            file_backup_plan_create=file_backup_plan_create,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "FileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def create_file_backup_plans_plan_backup_file_post_without_preload_content(
        self,
        file_backup_plan_create: FileBackupPlanCreate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create File Backup Plans

        # Create file backup plan  Create a new file backup plan in the backup manager. File plans wrap a complete backup configuration and must declare at least one absolute `config.source_paths` entry.  **Endpoint**: `POST /backup/file/`  **Auth**: requires an authenticated user.  ## Request body (FileBackupPlanCreate) - `name` (string, required): Human-friendly plan name. - `description` (string, optional): Optional free-text description of the plan. - `repo_id` (uuid, required): Target repository id. - `config` (ResticBackup, required): Must include `source_paths` (absolute paths); supports `exclude`, `iexclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, and `global_options.limit_download` / `global_options.limit_upload`. - `schedule_enabled` (bool, default `false`): Whether scheduling is active for this plan. - `schedule_configs` (list of uuid, optional): Scheduling configurations to attach at creation when `schedule_enabled` is true. - `affected_agents` (list of uuid, optional): Agents assigned to this backup plan upon creation. - `retention_settings` (RetentionSettings, optional): Retention policy applied after backup. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Hooks around the backup run. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: `config.source_paths` is mandatory and each path must be absolute. If provided, `pre_script`/`post_script` must include an executor and script path.

        :param file_backup_plan_create: (required)
        :type file_backup_plan_create: FileBackupPlanCreate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_file_backup_plans_plan_backup_file_post_serialize(
            file_backup_plan_create=file_backup_plan_create,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "FileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _create_file_backup_plans_plan_backup_file_post_serialize(
        self,
        file_backup_plan_create,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if file_backup_plan_create is not None:
            _body_params = file_backup_plan_create

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/file/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def create_image_backup_plans_plan_backup_image_post(
        self,
        image_backup_plan_create: ImageBackupPlanCreate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ImageBackupPlan:
        """Create Image Backup Plans

        # Create image backup plan  Create a new image backup plan in the backup manager. Image plans wrap backup configuration and must NOT declare `config.source_paths`; partitions are provided via the `extension` field.  **Endpoint**: `POST /backup/image/` **Auth**: requires an authenticated user.  ## Request body (ImageBackupPlanCreate) - `name` (string, required): Human-friendly plan name. - `description` (string, optional): Optional free-text description of the plan. - `repo_id` (uuid, required): Target repository id. - `config` (ResticBackup, required): Restic options; must omit `source_paths`. Only `global_options.limit_download` / `global_options.limit_upload` have an impact. - `schedule_enabled` (bool, default `false`): Whether scheduling is active for this plan. - `schedule_configs` (list of uuid, optional): Scheduling configurations to attach at creation when `schedule_enabled` is true. - `affected_agents` (list of uuid, optional): Agents assigned to this backup plan upon creation. - `extension` (ImageBackupPlanExtension, required): Disk-partitions map to backup. Example: `{ \"partitions\": { \"0\": [0,1] } }`. - `retention_settings` (RetentionSettings, optional): Retention policy applied after backup. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Hooks around the backup run. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: `config.source_paths` is forbidden for image plans. `extension.partitions` must be provided. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param image_backup_plan_create: (required)
        :type image_backup_plan_create: ImageBackupPlanCreate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_image_backup_plans_plan_backup_image_post_serialize(
            image_backup_plan_create=image_backup_plan_create,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def create_image_backup_plans_plan_backup_image_post_with_http_info(
        self,
        image_backup_plan_create: ImageBackupPlanCreate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ImageBackupPlan]:
        """Create Image Backup Plans

        # Create image backup plan  Create a new image backup plan in the backup manager. Image plans wrap backup configuration and must NOT declare `config.source_paths`; partitions are provided via the `extension` field.  **Endpoint**: `POST /backup/image/` **Auth**: requires an authenticated user.  ## Request body (ImageBackupPlanCreate) - `name` (string, required): Human-friendly plan name. - `description` (string, optional): Optional free-text description of the plan. - `repo_id` (uuid, required): Target repository id. - `config` (ResticBackup, required): Restic options; must omit `source_paths`. Only `global_options.limit_download` / `global_options.limit_upload` have an impact. - `schedule_enabled` (bool, default `false`): Whether scheduling is active for this plan. - `schedule_configs` (list of uuid, optional): Scheduling configurations to attach at creation when `schedule_enabled` is true. - `affected_agents` (list of uuid, optional): Agents assigned to this backup plan upon creation. - `extension` (ImageBackupPlanExtension, required): Disk-partitions map to backup. Example: `{ \"partitions\": { \"0\": [0,1] } }`. - `retention_settings` (RetentionSettings, optional): Retention policy applied after backup. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Hooks around the backup run. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: `config.source_paths` is forbidden for image plans. `extension.partitions` must be provided. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param image_backup_plan_create: (required)
        :type image_backup_plan_create: ImageBackupPlanCreate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_image_backup_plans_plan_backup_image_post_serialize(
            image_backup_plan_create=image_backup_plan_create,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def create_image_backup_plans_plan_backup_image_post_without_preload_content(
        self,
        image_backup_plan_create: ImageBackupPlanCreate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create Image Backup Plans

        # Create image backup plan  Create a new image backup plan in the backup manager. Image plans wrap backup configuration and must NOT declare `config.source_paths`; partitions are provided via the `extension` field.  **Endpoint**: `POST /backup/image/` **Auth**: requires an authenticated user.  ## Request body (ImageBackupPlanCreate) - `name` (string, required): Human-friendly plan name. - `description` (string, optional): Optional free-text description of the plan. - `repo_id` (uuid, required): Target repository id. - `config` (ResticBackup, required): Restic options; must omit `source_paths`. Only `global_options.limit_download` / `global_options.limit_upload` have an impact. - `schedule_enabled` (bool, default `false`): Whether scheduling is active for this plan. - `schedule_configs` (list of uuid, optional): Scheduling configurations to attach at creation when `schedule_enabled` is true. - `affected_agents` (list of uuid, optional): Agents assigned to this backup plan upon creation. - `extension` (ImageBackupPlanExtension, required): Disk-partitions map to backup. Example: `{ \"partitions\": { \"0\": [0,1] } }`. - `retention_settings` (RetentionSettings, optional): Retention policy applied after backup. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Hooks around the backup run. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: `config.source_paths` is forbidden for image plans. `extension.partitions` must be provided. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param image_backup_plan_create: (required)
        :type image_backup_plan_create: ImageBackupPlanCreate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_image_backup_plans_plan_backup_image_post_serialize(
            image_backup_plan_create=image_backup_plan_create,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "ImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _create_image_backup_plans_plan_backup_image_post_serialize(
        self,
        image_backup_plan_create,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if image_backup_plan_create is not None:
            _body_params = image_backup_plan_create

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/image/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def delete_file_backup_plans_plan_backup_file_plan_id_delete(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Delete File Backup Plans


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._delete_file_backup_plans_plan_backup_file_plan_id_delete_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def delete_file_backup_plans_plan_backup_file_plan_id_delete_with_http_info(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Delete File Backup Plans


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._delete_file_backup_plans_plan_backup_file_plan_id_delete_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def delete_file_backup_plans_plan_backup_file_plan_id_delete_without_preload_content(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete File Backup Plans


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._delete_file_backup_plans_plan_backup_file_plan_id_delete_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _delete_file_backup_plans_plan_backup_file_plan_id_delete_serialize(
        self,
        plan_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="DELETE",
            resource_path="/plan/backup/file/{plan_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def delete_image_backup_plans_plan_backup_image_plan_id_delete(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Delete Image Backup Plans


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._delete_image_backup_plans_plan_backup_image_plan_id_delete_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def delete_image_backup_plans_plan_backup_image_plan_id_delete_with_http_info(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Delete Image Backup Plans


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._delete_image_backup_plans_plan_backup_image_plan_id_delete_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def delete_image_backup_plans_plan_backup_image_plan_id_delete_without_preload_content(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Delete Image Backup Plans


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._delete_image_backup_plans_plan_backup_image_plan_id_delete_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _delete_image_backup_plans_plan_backup_image_plan_id_delete_serialize(
        self,
        plan_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="DELETE",
            resource_path="/plan/backup/image/{plan_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def execute_file_backup_plan_plan_backup_file_plan_id_execute_post(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        additional_agent_filter: Optional[AdditionalAgentFilter] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Execute File Backup Plan


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param additional_agent_filter:
        :type additional_agent_filter: AdditionalAgentFilter
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._execute_file_backup_plan_plan_backup_file_plan_id_execute_post_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            additional_agent_filter=additional_agent_filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def execute_file_backup_plan_plan_backup_file_plan_id_execute_post_with_http_info(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        additional_agent_filter: Optional[AdditionalAgentFilter] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Execute File Backup Plan


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param additional_agent_filter:
        :type additional_agent_filter: AdditionalAgentFilter
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._execute_file_backup_plan_plan_backup_file_plan_id_execute_post_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            additional_agent_filter=additional_agent_filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def execute_file_backup_plan_plan_backup_file_plan_id_execute_post_without_preload_content(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        additional_agent_filter: Optional[AdditionalAgentFilter] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Execute File Backup Plan


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param additional_agent_filter:
        :type additional_agent_filter: AdditionalAgentFilter
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._execute_file_backup_plan_plan_backup_file_plan_id_execute_post_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            additional_agent_filter=additional_agent_filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _execute_file_backup_plan_plan_backup_file_plan_id_execute_post_serialize(
        self,
        plan_id,
        cbe_user_org_id,
        additional_agent_filter,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if additional_agent_filter is not None:
            _body_params = additional_agent_filter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/file/{plan_id}/execute/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def execute_image_backup_plan_plan_backup_image_plan_id_execute_post(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        additional_agent_filter: Optional[AdditionalAgentFilter] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> object:
        """Execute Image Backup Plan


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param additional_agent_filter:
        :type additional_agent_filter: AdditionalAgentFilter
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._execute_image_backup_plan_plan_backup_image_plan_id_execute_post_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            additional_agent_filter=additional_agent_filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def execute_image_backup_plan_plan_backup_image_plan_id_execute_post_with_http_info(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        additional_agent_filter: Optional[AdditionalAgentFilter] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[object]:
        """Execute Image Backup Plan


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param additional_agent_filter:
        :type additional_agent_filter: AdditionalAgentFilter
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._execute_image_backup_plan_plan_backup_image_plan_id_execute_post_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            additional_agent_filter=additional_agent_filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def execute_image_backup_plan_plan_backup_image_plan_id_execute_post_without_preload_content(
        self,
        plan_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        additional_agent_filter: Optional[AdditionalAgentFilter] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Execute Image Backup Plan


        :param plan_id: (required)
        :type plan_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :param additional_agent_filter:
        :type additional_agent_filter: AdditionalAgentFilter
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._execute_image_backup_plan_plan_backup_image_plan_id_execute_post_serialize(
            plan_id=plan_id,
            cbe_user_org_id=cbe_user_org_id,
            additional_agent_filter=additional_agent_filter,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "202": "object",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _execute_image_backup_plan_plan_backup_image_plan_id_execute_post_serialize(
        self,
        plan_id,
        cbe_user_org_id,
        additional_agent_filter,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if additional_agent_filter is not None:
            _body_params = additional_agent_filter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/image/{plan_id}/execute/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def get_running_plan_status_plan_backup_run_plan_run_id_status_get(
        self,
        plan_run_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> BackupInfo:
        """Get Running Plan Status


        :param plan_run_id: (required)
        :type plan_run_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_running_plan_status_plan_backup_run_plan_run_id_status_get_serialize(
            plan_run_id=plan_run_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "BackupInfo",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def get_running_plan_status_plan_backup_run_plan_run_id_status_get_with_http_info(
        self,
        plan_run_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[BackupInfo]:
        """Get Running Plan Status


        :param plan_run_id: (required)
        :type plan_run_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_running_plan_status_plan_backup_run_plan_run_id_status_get_serialize(
            plan_run_id=plan_run_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "BackupInfo",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def get_running_plan_status_plan_backup_run_plan_run_id_status_get_without_preload_content(
        self,
        plan_run_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Running Plan Status


        :param plan_run_id: (required)
        :type plan_run_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._get_running_plan_status_plan_backup_run_plan_run_id_status_get_serialize(
            plan_run_id=plan_run_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "BackupInfo",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _get_running_plan_status_plan_backup_run_plan_run_id_status_get_serialize(
        self,
        plan_run_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_run_id is not None:
            _path_params["plan_run_id"] = plan_run_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/plan/backup/run/{plan_run_id}/status/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def list_all_backup_history_error_plan_backup_history_error_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        backup_run_id: Optional[UUID] = None,
        during: Optional[StrictStr] = None,
        item: Optional[StrictStr] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PageBackupPlanError:
        """List All Backup History Error


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param backup_run_id:
        :type backup_run_id: UUID
        :param during:
        :type during: str
        :param item:
        :type item: str
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_backup_history_error_plan_backup_history_error_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            backup_run_id=backup_run_id,
            during=during,
            item=item,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanError",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_all_backup_history_error_plan_backup_history_error_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        backup_run_id: Optional[UUID] = None,
        during: Optional[StrictStr] = None,
        item: Optional[StrictStr] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PageBackupPlanError]:
        """List All Backup History Error


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param backup_run_id:
        :type backup_run_id: UUID
        :param during:
        :type during: str
        :param item:
        :type item: str
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_backup_history_error_plan_backup_history_error_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            backup_run_id=backup_run_id,
            during=during,
            item=item,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanError",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_all_backup_history_error_plan_backup_history_error_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        backup_run_id: Optional[UUID] = None,
        during: Optional[StrictStr] = None,
        item: Optional[StrictStr] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List All Backup History Error


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param backup_run_id:
        :type backup_run_id: UUID
        :param during:
        :type during: str
        :param item:
        :type item: str
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_backup_history_error_plan_backup_history_error_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            backup_run_id=backup_run_id,
            during=during,
            item=item,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanError",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_all_backup_history_error_plan_backup_history_error_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        backup_run_id,
        during,
        item,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
        }

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if backup_run_id is not None:
            _query_params.append(("backup_run_id", backup_run_id))

        if during is not None:
            _query_params.append(("during", during))

        if item is not None:
            _query_params.append(("item", item))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/plan/backup/history/error/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def list_all_backup_history_plan_backup_history_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        plan_id: Optional[UUID] = None,
        repository_id: Optional[UUID] = None,
        agent_id: Optional[UUID] = None,
        status: Optional[Any] = None,
        finished_at_gt: Optional[datetime] = None,
        finished_at_lt: Optional[datetime] = None,
        programmed_at_gt: Optional[datetime] = None,
        programmed_at_lt: Optional[datetime] = None,
        started_at_gt: Optional[datetime] = None,
        started_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PageBackupPlanRun:
        """List All Backup History


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param plan_id:
        :type plan_id: UUID
        :param repository_id:
        :type repository_id: UUID
        :param agent_id:
        :type agent_id: UUID
        :param status:
        :type status: PlanStatus
        :param finished_at_gt:
        :type finished_at_gt: datetime
        :param finished_at_lt:
        :type finished_at_lt: datetime
        :param programmed_at_gt:
        :type programmed_at_gt: datetime
        :param programmed_at_lt:
        :type programmed_at_lt: datetime
        :param started_at_gt:
        :type started_at_gt: datetime
        :param started_at_lt:
        :type started_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_backup_history_plan_backup_history_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            plan_id=plan_id,
            repository_id=repository_id,
            agent_id=agent_id,
            status=status,
            finished_at_gt=finished_at_gt,
            finished_at_lt=finished_at_lt,
            programmed_at_gt=programmed_at_gt,
            programmed_at_lt=programmed_at_lt,
            started_at_gt=started_at_gt,
            started_at_lt=started_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanRun",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_all_backup_history_plan_backup_history_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        plan_id: Optional[UUID] = None,
        repository_id: Optional[UUID] = None,
        agent_id: Optional[UUID] = None,
        status: Optional[Any] = None,
        finished_at_gt: Optional[datetime] = None,
        finished_at_lt: Optional[datetime] = None,
        programmed_at_gt: Optional[datetime] = None,
        programmed_at_lt: Optional[datetime] = None,
        started_at_gt: Optional[datetime] = None,
        started_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PageBackupPlanRun]:
        """List All Backup History


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param plan_id:
        :type plan_id: UUID
        :param repository_id:
        :type repository_id: UUID
        :param agent_id:
        :type agent_id: UUID
        :param status:
        :type status: PlanStatus
        :param finished_at_gt:
        :type finished_at_gt: datetime
        :param finished_at_lt:
        :type finished_at_lt: datetime
        :param programmed_at_gt:
        :type programmed_at_gt: datetime
        :param programmed_at_lt:
        :type programmed_at_lt: datetime
        :param started_at_gt:
        :type started_at_gt: datetime
        :param started_at_lt:
        :type started_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_backup_history_plan_backup_history_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            plan_id=plan_id,
            repository_id=repository_id,
            agent_id=agent_id,
            status=status,
            finished_at_gt=finished_at_gt,
            finished_at_lt=finished_at_lt,
            programmed_at_gt=programmed_at_gt,
            programmed_at_lt=programmed_at_lt,
            started_at_gt=started_at_gt,
            started_at_lt=started_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanRun",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_all_backup_history_plan_backup_history_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        plan_id: Optional[UUID] = None,
        repository_id: Optional[UUID] = None,
        agent_id: Optional[UUID] = None,
        status: Optional[Any] = None,
        finished_at_gt: Optional[datetime] = None,
        finished_at_lt: Optional[datetime] = None,
        programmed_at_gt: Optional[datetime] = None,
        programmed_at_lt: Optional[datetime] = None,
        started_at_gt: Optional[datetime] = None,
        started_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List All Backup History


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param plan_id:
        :type plan_id: UUID
        :param repository_id:
        :type repository_id: UUID
        :param agent_id:
        :type agent_id: UUID
        :param status:
        :type status: PlanStatus
        :param finished_at_gt:
        :type finished_at_gt: datetime
        :param finished_at_lt:
        :type finished_at_lt: datetime
        :param programmed_at_gt:
        :type programmed_at_gt: datetime
        :param programmed_at_lt:
        :type programmed_at_lt: datetime
        :param started_at_gt:
        :type started_at_gt: datetime
        :param started_at_lt:
        :type started_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_backup_history_plan_backup_history_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            plan_id=plan_id,
            repository_id=repository_id,
            agent_id=agent_id,
            status=status,
            finished_at_gt=finished_at_gt,
            finished_at_lt=finished_at_lt,
            programmed_at_gt=programmed_at_gt,
            programmed_at_lt=programmed_at_lt,
            started_at_gt=started_at_gt,
            started_at_lt=started_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanRun",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_all_backup_history_plan_backup_history_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        plan_id,
        repository_id,
        agent_id,
        status,
        finished_at_gt,
        finished_at_lt,
        programmed_at_gt,
        programmed_at_lt,
        started_at_gt,
        started_at_lt,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
        }

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if plan_id is not None:
            _query_params.append(("plan_id", plan_id))

        if repository_id is not None:
            _query_params.append(("repository_id", repository_id))

        if agent_id is not None:
            _query_params.append(("agent_id", agent_id))

        if status is not None:
            _query_params.append(("status", status.value))

        if finished_at_gt is not None:
            if isinstance(finished_at_gt, datetime):
                _query_params.append(
                    ("finished_at_gt", finished_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("finished_at_gt", finished_at_gt))

        if finished_at_lt is not None:
            if isinstance(finished_at_lt, datetime):
                _query_params.append(
                    ("finished_at_lt", finished_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("finished_at_lt", finished_at_lt))

        if programmed_at_gt is not None:
            if isinstance(programmed_at_gt, datetime):
                _query_params.append(
                    ("programmed_at_gt", programmed_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("programmed_at_gt", programmed_at_gt))

        if programmed_at_lt is not None:
            if isinstance(programmed_at_lt, datetime):
                _query_params.append(
                    ("programmed_at_lt", programmed_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("programmed_at_lt", programmed_at_lt))

        if started_at_gt is not None:
            if isinstance(started_at_gt, datetime):
                _query_params.append(
                    ("started_at_gt", started_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("started_at_gt", started_at_gt))

        if started_at_lt is not None:
            if isinstance(started_at_lt, datetime):
                _query_params.append(
                    ("started_at_lt", started_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("started_at_lt", started_at_lt))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/plan/backup/history/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def list_all_latest_backup_history_plan_backup_history_latest_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        plan_id: Optional[UUID] = None,
        repository_id: Optional[UUID] = None,
        agent_id: Optional[UUID] = None,
        status: Optional[Any] = None,
        finished_at_gt: Optional[datetime] = None,
        finished_at_lt: Optional[datetime] = None,
        programmed_at_gt: Optional[datetime] = None,
        programmed_at_lt: Optional[datetime] = None,
        started_at_gt: Optional[datetime] = None,
        started_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PageBackupPlanRun:
        """List All Latest Backup History


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param plan_id:
        :type plan_id: UUID
        :param repository_id:
        :type repository_id: UUID
        :param agent_id:
        :type agent_id: UUID
        :param status:
        :type status: PlanStatus
        :param finished_at_gt:
        :type finished_at_gt: datetime
        :param finished_at_lt:
        :type finished_at_lt: datetime
        :param programmed_at_gt:
        :type programmed_at_gt: datetime
        :param programmed_at_lt:
        :type programmed_at_lt: datetime
        :param started_at_gt:
        :type started_at_gt: datetime
        :param started_at_lt:
        :type started_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_latest_backup_history_plan_backup_history_latest_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            plan_id=plan_id,
            repository_id=repository_id,
            agent_id=agent_id,
            status=status,
            finished_at_gt=finished_at_gt,
            finished_at_lt=finished_at_lt,
            programmed_at_gt=programmed_at_gt,
            programmed_at_lt=programmed_at_lt,
            started_at_gt=started_at_gt,
            started_at_lt=started_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanRun",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_all_latest_backup_history_plan_backup_history_latest_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        plan_id: Optional[UUID] = None,
        repository_id: Optional[UUID] = None,
        agent_id: Optional[UUID] = None,
        status: Optional[Any] = None,
        finished_at_gt: Optional[datetime] = None,
        finished_at_lt: Optional[datetime] = None,
        programmed_at_gt: Optional[datetime] = None,
        programmed_at_lt: Optional[datetime] = None,
        started_at_gt: Optional[datetime] = None,
        started_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PageBackupPlanRun]:
        """List All Latest Backup History


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param plan_id:
        :type plan_id: UUID
        :param repository_id:
        :type repository_id: UUID
        :param agent_id:
        :type agent_id: UUID
        :param status:
        :type status: PlanStatus
        :param finished_at_gt:
        :type finished_at_gt: datetime
        :param finished_at_lt:
        :type finished_at_lt: datetime
        :param programmed_at_gt:
        :type programmed_at_gt: datetime
        :param programmed_at_lt:
        :type programmed_at_lt: datetime
        :param started_at_gt:
        :type started_at_gt: datetime
        :param started_at_lt:
        :type started_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_latest_backup_history_plan_backup_history_latest_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            plan_id=plan_id,
            repository_id=repository_id,
            agent_id=agent_id,
            status=status,
            finished_at_gt=finished_at_gt,
            finished_at_lt=finished_at_lt,
            programmed_at_gt=programmed_at_gt,
            programmed_at_lt=programmed_at_lt,
            started_at_gt=started_at_gt,
            started_at_lt=started_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanRun",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_all_latest_backup_history_plan_backup_history_latest_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        plan_id: Optional[UUID] = None,
        repository_id: Optional[UUID] = None,
        agent_id: Optional[UUID] = None,
        status: Optional[Any] = None,
        finished_at_gt: Optional[datetime] = None,
        finished_at_lt: Optional[datetime] = None,
        programmed_at_gt: Optional[datetime] = None,
        programmed_at_lt: Optional[datetime] = None,
        started_at_gt: Optional[datetime] = None,
        started_at_lt: Optional[datetime] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List All Latest Backup History


        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param plan_id:
        :type plan_id: UUID
        :param repository_id:
        :type repository_id: UUID
        :param agent_id:
        :type agent_id: UUID
        :param status:
        :type status: PlanStatus
        :param finished_at_gt:
        :type finished_at_gt: datetime
        :param finished_at_lt:
        :type finished_at_lt: datetime
        :param programmed_at_gt:
        :type programmed_at_gt: datetime
        :param programmed_at_lt:
        :type programmed_at_lt: datetime
        :param started_at_gt:
        :type started_at_gt: datetime
        :param started_at_lt:
        :type started_at_lt: datetime
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_all_latest_backup_history_plan_backup_history_latest_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            plan_id=plan_id,
            repository_id=repository_id,
            agent_id=agent_id,
            status=status,
            finished_at_gt=finished_at_gt,
            finished_at_lt=finished_at_lt,
            programmed_at_gt=programmed_at_gt,
            programmed_at_lt=programmed_at_lt,
            started_at_gt=started_at_gt,
            started_at_lt=started_at_lt,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageBackupPlanRun",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_all_latest_backup_history_plan_backup_history_latest_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        plan_id,
        repository_id,
        agent_id,
        status,
        finished_at_gt,
        finished_at_lt,
        programmed_at_gt,
        programmed_at_lt,
        started_at_gt,
        started_at_lt,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
        }

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if plan_id is not None:
            _query_params.append(("plan_id", plan_id))

        if repository_id is not None:
            _query_params.append(("repository_id", repository_id))

        if agent_id is not None:
            _query_params.append(("agent_id", agent_id))

        if status is not None:
            _query_params.append(("status", status.value))

        if finished_at_gt is not None:
            if isinstance(finished_at_gt, datetime):
                _query_params.append(
                    ("finished_at_gt", finished_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("finished_at_gt", finished_at_gt))

        if finished_at_lt is not None:
            if isinstance(finished_at_lt, datetime):
                _query_params.append(
                    ("finished_at_lt", finished_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("finished_at_lt", finished_at_lt))

        if programmed_at_gt is not None:
            if isinstance(programmed_at_gt, datetime):
                _query_params.append(
                    ("programmed_at_gt", programmed_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("programmed_at_gt", programmed_at_gt))

        if programmed_at_lt is not None:
            if isinstance(programmed_at_lt, datetime):
                _query_params.append(
                    ("programmed_at_lt", programmed_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("programmed_at_lt", programmed_at_lt))

        if started_at_gt is not None:
            if isinstance(started_at_gt, datetime):
                _query_params.append(
                    ("started_at_gt", started_at_gt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("started_at_gt", started_at_gt))

        if started_at_lt is not None:
            if isinstance(started_at_lt, datetime):
                _query_params.append(
                    ("started_at_lt", started_at_lt.strftime(self.api_client.configuration.datetime_format))
                )
            else:
                _query_params.append(("started_at_lt", started_at_lt))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/plan/backup/history/latest/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def list_file_backup_plans_plan_backup_file_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        name: Optional[Any] = None,
        repo_id: Optional[UUID] = None,
        schedule_enabled: Optional[StrictBool] = None,
        linked_agents_contains: Optional[List[UUID]] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PageFileBackupPlan:
        """List File Backup Plans

        # List file backup plans  Fetch a paginated list of file backup plans configured in the backup manager. File plans wrap restic backup configuration and must declare at least one `config.source_paths` entry.  **Endpoint**: `GET /backup/file/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (uuid): Filter by plan id. - `name` (string): Filter by plan name. - `repo_id` (uuid): Filter by repository id. - `schedule_enabled` (bool): Filter by whether scheduling is enabled. - `linked_agents_contains` (list[uuid]): Return plans assigned to any of the provided agent ids.  ## Response `200 OK` with a `Page[FileBackupPlan]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of file backup plans with fields:   - `id`, `name`, `description`, `repo_id`   - `config`: Restic backup options (must include `source_paths`; may also include `exclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, `iexclude`, `global_options.limit_download`, `global_options.limit_upload`).   - `retention_settings`: Retention limits (`keep_*` and `keep_within_*_as_secs` fields).   - `schedule_enabled`, `schedule_configs`   - `last_executed`: Timestamp of the most recent run.   - `timestamps`: `created_at`, `updated_at`   - `affected_agents`: Agents linked to the plan.   - `pre_script`, `post_script`: Optional scripts (executor, script_path, args, envs, abort_if_fail, script).  ### Example  ```http GET /backup/file/?page=0&per_page=25&repo_id=2783d0b1-d178-499b-ad7b-733670bde27b HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"c85a857f-4d70-4099-b84f-a6b74ea999de\",       \"name\": \"Workstations home folders\",       \"description\": null,       \"repo_id\": \"2783d0b1-d178-499b-ad7b-733670bde27b\",       \"config\": {         \"global_options\": {           \"limit_download\": null,           \"limit_upload\": null         },         \"source_paths\": [\"C:\\\\Users\"],         \"exclude\": [\"*.tmp\"],         \"exclude_caches\": true,         \"exclude_if_present\": [],         \"exclude_larger_than\": null,         \"iexclude\": []       },       \"retention_settings\": {         \"keep_last\": 7,         \"keep_hourly\": null,         \"keep_daily\": null,         \"keep_weekly\": null,         \"keep_monthly\": null,         \"keep_yearly\": null,         \"keep_within_as_secs\": null,         \"keep_within_hourly_as_secs\": null,         \"keep_within_daily_as_secs\": null,         \"keep_within_weekly_as_secs\": null,         \"keep_within_monthly_as_secs\": null,         \"keep_within_yearly_as_secs\": null       },       \"schedule_enabled\": true,       \"schedule_configs\": [\"b180658b-1799-4563-a5ce-2eb131e51e0e\"],       \"last_executed\": \"2024-05-06T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-05T07:15:10Z\"       },       \"affected_agents\": [\"e33602da-cb5f-4b5f-9c49-6307b32cfac7\"],       \"pre_script\": null,       \"post_script\": null     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param name:
        :type name: str
        :param repo_id:
        :type repo_id: UUID
        :param schedule_enabled:
        :type schedule_enabled: bool
        :param linked_agents_contains:
        :type linked_agents_contains: List[UUID]
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_file_backup_plans_plan_backup_file_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            repo_id=repo_id,
            schedule_enabled=schedule_enabled,
            linked_agents_contains=linked_agents_contains,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageFileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_file_backup_plans_plan_backup_file_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        name: Optional[Any] = None,
        repo_id: Optional[UUID] = None,
        schedule_enabled: Optional[StrictBool] = None,
        linked_agents_contains: Optional[List[UUID]] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PageFileBackupPlan]:
        """List File Backup Plans

        # List file backup plans  Fetch a paginated list of file backup plans configured in the backup manager. File plans wrap restic backup configuration and must declare at least one `config.source_paths` entry.  **Endpoint**: `GET /backup/file/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (uuid): Filter by plan id. - `name` (string): Filter by plan name. - `repo_id` (uuid): Filter by repository id. - `schedule_enabled` (bool): Filter by whether scheduling is enabled. - `linked_agents_contains` (list[uuid]): Return plans assigned to any of the provided agent ids.  ## Response `200 OK` with a `Page[FileBackupPlan]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of file backup plans with fields:   - `id`, `name`, `description`, `repo_id`   - `config`: Restic backup options (must include `source_paths`; may also include `exclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, `iexclude`, `global_options.limit_download`, `global_options.limit_upload`).   - `retention_settings`: Retention limits (`keep_*` and `keep_within_*_as_secs` fields).   - `schedule_enabled`, `schedule_configs`   - `last_executed`: Timestamp of the most recent run.   - `timestamps`: `created_at`, `updated_at`   - `affected_agents`: Agents linked to the plan.   - `pre_script`, `post_script`: Optional scripts (executor, script_path, args, envs, abort_if_fail, script).  ### Example  ```http GET /backup/file/?page=0&per_page=25&repo_id=2783d0b1-d178-499b-ad7b-733670bde27b HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"c85a857f-4d70-4099-b84f-a6b74ea999de\",       \"name\": \"Workstations home folders\",       \"description\": null,       \"repo_id\": \"2783d0b1-d178-499b-ad7b-733670bde27b\",       \"config\": {         \"global_options\": {           \"limit_download\": null,           \"limit_upload\": null         },         \"source_paths\": [\"C:\\\\Users\"],         \"exclude\": [\"*.tmp\"],         \"exclude_caches\": true,         \"exclude_if_present\": [],         \"exclude_larger_than\": null,         \"iexclude\": []       },       \"retention_settings\": {         \"keep_last\": 7,         \"keep_hourly\": null,         \"keep_daily\": null,         \"keep_weekly\": null,         \"keep_monthly\": null,         \"keep_yearly\": null,         \"keep_within_as_secs\": null,         \"keep_within_hourly_as_secs\": null,         \"keep_within_daily_as_secs\": null,         \"keep_within_weekly_as_secs\": null,         \"keep_within_monthly_as_secs\": null,         \"keep_within_yearly_as_secs\": null       },       \"schedule_enabled\": true,       \"schedule_configs\": [\"b180658b-1799-4563-a5ce-2eb131e51e0e\"],       \"last_executed\": \"2024-05-06T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-05T07:15:10Z\"       },       \"affected_agents\": [\"e33602da-cb5f-4b5f-9c49-6307b32cfac7\"],       \"pre_script\": null,       \"post_script\": null     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param name:
        :type name: str
        :param repo_id:
        :type repo_id: UUID
        :param schedule_enabled:
        :type schedule_enabled: bool
        :param linked_agents_contains:
        :type linked_agents_contains: List[UUID]
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_file_backup_plans_plan_backup_file_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            repo_id=repo_id,
            schedule_enabled=schedule_enabled,
            linked_agents_contains=linked_agents_contains,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageFileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_file_backup_plans_plan_backup_file_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        name: Optional[Any] = None,
        repo_id: Optional[UUID] = None,
        schedule_enabled: Optional[StrictBool] = None,
        linked_agents_contains: Optional[List[UUID]] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List File Backup Plans

        # List file backup plans  Fetch a paginated list of file backup plans configured in the backup manager. File plans wrap restic backup configuration and must declare at least one `config.source_paths` entry.  **Endpoint**: `GET /backup/file/`  **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (uuid): Filter by plan id. - `name` (string): Filter by plan name. - `repo_id` (uuid): Filter by repository id. - `schedule_enabled` (bool): Filter by whether scheduling is enabled. - `linked_agents_contains` (list[uuid]): Return plans assigned to any of the provided agent ids.  ## Response `200 OK` with a `Page[FileBackupPlan]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of file backup plans with fields:   - `id`, `name`, `description`, `repo_id`   - `config`: Restic backup options (must include `source_paths`; may also include `exclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, `iexclude`, `global_options.limit_download`, `global_options.limit_upload`).   - `retention_settings`: Retention limits (`keep_*` and `keep_within_*_as_secs` fields).   - `schedule_enabled`, `schedule_configs`   - `last_executed`: Timestamp of the most recent run.   - `timestamps`: `created_at`, `updated_at`   - `affected_agents`: Agents linked to the plan.   - `pre_script`, `post_script`: Optional scripts (executor, script_path, args, envs, abort_if_fail, script).  ### Example  ```http GET /backup/file/?page=0&per_page=25&repo_id=2783d0b1-d178-499b-ad7b-733670bde27b HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"c85a857f-4d70-4099-b84f-a6b74ea999de\",       \"name\": \"Workstations home folders\",       \"description\": null,       \"repo_id\": \"2783d0b1-d178-499b-ad7b-733670bde27b\",       \"config\": {         \"global_options\": {           \"limit_download\": null,           \"limit_upload\": null         },         \"source_paths\": [\"C:\\\\Users\"],         \"exclude\": [\"*.tmp\"],         \"exclude_caches\": true,         \"exclude_if_present\": [],         \"exclude_larger_than\": null,         \"iexclude\": []       },       \"retention_settings\": {         \"keep_last\": 7,         \"keep_hourly\": null,         \"keep_daily\": null,         \"keep_weekly\": null,         \"keep_monthly\": null,         \"keep_yearly\": null,         \"keep_within_as_secs\": null,         \"keep_within_hourly_as_secs\": null,         \"keep_within_daily_as_secs\": null,         \"keep_within_weekly_as_secs\": null,         \"keep_within_monthly_as_secs\": null,         \"keep_within_yearly_as_secs\": null       },       \"schedule_enabled\": true,       \"schedule_configs\": [\"b180658b-1799-4563-a5ce-2eb131e51e0e\"],       \"last_executed\": \"2024-05-06T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-05T07:15:10Z\"       },       \"affected_agents\": [\"e33602da-cb5f-4b5f-9c49-6307b32cfac7\"],       \"pre_script\": null,       \"post_script\": null     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param name:
        :type name: str
        :param repo_id:
        :type repo_id: UUID
        :param schedule_enabled:
        :type schedule_enabled: bool
        :param linked_agents_contains:
        :type linked_agents_contains: List[UUID]
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_file_backup_plans_plan_backup_file_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            repo_id=repo_id,
            schedule_enabled=schedule_enabled,
            linked_agents_contains=linked_agents_contains,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageFileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_file_backup_plans_plan_backup_file_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        name,
        repo_id,
        schedule_enabled,
        linked_agents_contains,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
            "linked_agents_contains": "multi",
        }

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if name is not None:
            _query_params.append(("name", name))

        if repo_id is not None:
            _query_params.append(("repo_id", repo_id))

        if schedule_enabled is not None:
            _query_params.append(("schedule_enabled", schedule_enabled))

        if linked_agents_contains is not None:
            _query_params.append(("linked_agents_contains", linked_agents_contains))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/plan/backup/file/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def list_image_backup_plans_plan_backup_image_get(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        name: Optional[StrictStr] = None,
        repo_id: Optional[UUID] = None,
        schedule_enabled: Optional[StrictBool] = None,
        linked_agents_contains: Optional[List[UUID]] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> PageImageBackupPlan:
        """List Image Backup Plans

        # List image backup plans  Fetch a paginated list of image backup plans configured in the backup manager.  **Endpoint**: `GET /backup/image/` **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (uuid): Filter by plan id. - `name` (string): Filter by plan name. - `repo_id` (uuid): Filter by repository id. - `schedule_enabled` (bool): Filter by whether scheduling is enabled. - `linked_agents_contains` (list[uuid]): Return plans assigned to any of the provided agent ids.  ## Response `200 OK` with a `Page[ImageBackupPlan]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of image backup plans with fields:   - `id`, `name`, `description`, `repo_id`   - `config`: Restic backup options (must omit `source_paths`; only `global_options.limit_download` have an impact, `global_options.limit_upload`).   - `extension.partitions`: Map of device index to partition index lists.   - `retention_settings`: Retention limits (`keep_*` and `keep_within_*_as_secs` fields).   - `schedule_enabled`, `schedule_configs`   - `last_executed`: Timestamp of the most recent run.   - `timestamps`: `created_at`, `updated_at`   - `affected_agents`: Agents linked to the plan.   - `pre_script`, `post_script`: Optional scripts (executor, script_path, args, envs, abort_if_fail, script).  ### Example  ```http GET /backup/image/?page=0&per_page=25&repo_id=2783d0b1-d178-499b-ad7b-733670bde27b HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"7b3a9d8a-ea9b-4dc1-9d1e-3cb3104f0d3c\",       \"name\": \"Primary workstation image\",       \"description\": null,       \"repo_id\": \"2783d0b1-d178-499b-ad7b-733670bde27b\",       \"config\": {         \"global_options\": {           \"limit_download\": null,           \"limit_upload\": null         },         \"exclude\": [],         \"exclude_caches\": false,         \"exclude_if_present\": [],         \"exclude_larger_than\": null,         \"iexclude\": []       },       \"extension\": {         \"partitions\": {           \"0\": [0, 1]         }       },       \"retention_settings\": {         \"keep_last\": 3,         \"keep_hourly\": null,         \"keep_daily\": null,         \"keep_weekly\": null,         \"keep_monthly\": null,         \"keep_yearly\": null,         \"keep_within_as_secs\": null,         \"keep_within_hourly_as_secs\": null,         \"keep_within_daily_as_secs\": null,         \"keep_within_weekly_as_secs\": null,         \"keep_within_monthly_as_secs\": null,         \"keep_within_yearly_as_secs\": null       },       \"schedule_enabled\": true,       \"schedule_configs\": [\"b180658b-1799-4563-a5ce-2eb131e51e0e\"],       \"last_executed\": \"2024-05-06T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-05T07:15:10Z\"       },       \"affected_agents\": [\"e33602da-cb5f-4b5f-9c49-6307b32cfac7\"],       \"pre_script\": null,       \"post_script\": null     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param name:
        :type name: str
        :param repo_id:
        :type repo_id: UUID
        :param schedule_enabled:
        :type schedule_enabled: bool
        :param linked_agents_contains:
        :type linked_agents_contains: List[UUID]
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_image_backup_plans_plan_backup_image_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            repo_id=repo_id,
            schedule_enabled=schedule_enabled,
            linked_agents_contains=linked_agents_contains,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def list_image_backup_plans_plan_backup_image_get_with_http_info(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        name: Optional[StrictStr] = None,
        repo_id: Optional[UUID] = None,
        schedule_enabled: Optional[StrictBool] = None,
        linked_agents_contains: Optional[List[UUID]] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[PageImageBackupPlan]:
        """List Image Backup Plans

        # List image backup plans  Fetch a paginated list of image backup plans configured in the backup manager.  **Endpoint**: `GET /backup/image/` **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (uuid): Filter by plan id. - `name` (string): Filter by plan name. - `repo_id` (uuid): Filter by repository id. - `schedule_enabled` (bool): Filter by whether scheduling is enabled. - `linked_agents_contains` (list[uuid]): Return plans assigned to any of the provided agent ids.  ## Response `200 OK` with a `Page[ImageBackupPlan]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of image backup plans with fields:   - `id`, `name`, `description`, `repo_id`   - `config`: Restic backup options (must omit `source_paths`; only `global_options.limit_download` have an impact, `global_options.limit_upload`).   - `extension.partitions`: Map of device index to partition index lists.   - `retention_settings`: Retention limits (`keep_*` and `keep_within_*_as_secs` fields).   - `schedule_enabled`, `schedule_configs`   - `last_executed`: Timestamp of the most recent run.   - `timestamps`: `created_at`, `updated_at`   - `affected_agents`: Agents linked to the plan.   - `pre_script`, `post_script`: Optional scripts (executor, script_path, args, envs, abort_if_fail, script).  ### Example  ```http GET /backup/image/?page=0&per_page=25&repo_id=2783d0b1-d178-499b-ad7b-733670bde27b HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"7b3a9d8a-ea9b-4dc1-9d1e-3cb3104f0d3c\",       \"name\": \"Primary workstation image\",       \"description\": null,       \"repo_id\": \"2783d0b1-d178-499b-ad7b-733670bde27b\",       \"config\": {         \"global_options\": {           \"limit_download\": null,           \"limit_upload\": null         },         \"exclude\": [],         \"exclude_caches\": false,         \"exclude_if_present\": [],         \"exclude_larger_than\": null,         \"iexclude\": []       },       \"extension\": {         \"partitions\": {           \"0\": [0, 1]         }       },       \"retention_settings\": {         \"keep_last\": 3,         \"keep_hourly\": null,         \"keep_daily\": null,         \"keep_weekly\": null,         \"keep_monthly\": null,         \"keep_yearly\": null,         \"keep_within_as_secs\": null,         \"keep_within_hourly_as_secs\": null,         \"keep_within_daily_as_secs\": null,         \"keep_within_weekly_as_secs\": null,         \"keep_within_monthly_as_secs\": null,         \"keep_within_yearly_as_secs\": null       },       \"schedule_enabled\": true,       \"schedule_configs\": [\"b180658b-1799-4563-a5ce-2eb131e51e0e\"],       \"last_executed\": \"2024-05-06T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-05T07:15:10Z\"       },       \"affected_agents\": [\"e33602da-cb5f-4b5f-9c49-6307b32cfac7\"],       \"pre_script\": null,       \"post_script\": null     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param name:
        :type name: str
        :param repo_id:
        :type repo_id: UUID
        :param schedule_enabled:
        :type schedule_enabled: bool
        :param linked_agents_contains:
        :type linked_agents_contains: List[UUID]
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_image_backup_plans_plan_backup_image_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            repo_id=repo_id,
            schedule_enabled=schedule_enabled,
            linked_agents_contains=linked_agents_contains,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def list_image_backup_plans_plan_backup_image_get_without_preload_content(
        self,
        page: Optional[Annotated[int, Field(strict=True, ge=0)]] = None,
        per_page: Optional[Annotated[int, Field(le=50, strict=True, ge=1)]] = None,
        order_by: Optional[List[StrictStr]] = None,
        id: Optional[UUID] = None,
        name: Optional[StrictStr] = None,
        repo_id: Optional[UUID] = None,
        schedule_enabled: Optional[StrictBool] = None,
        linked_agents_contains: Optional[List[UUID]] = None,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List Image Backup Plans

        # List image backup plans  Fetch a paginated list of image backup plans configured in the backup manager.  **Endpoint**: `GET /backup/image/` **Auth**: requires an authenticated user.  ## Query parameters - `page` (int, default 0): Zero-based page index. - `per_page` (int, default 25, max 50): Page size. - `order_by` (list[str]): Optional sort fields forwarded to the backend. - `id` (uuid): Filter by plan id. - `name` (string): Filter by plan name. - `repo_id` (uuid): Filter by repository id. - `schedule_enabled` (bool): Filter by whether scheduling is enabled. - `linked_agents_contains` (list[uuid]): Return plans assigned to any of the provided agent ids.  ## Response `200 OK` with a `Page[ImageBackupPlan]` body: - `page`, `per_page`, `total_items`, `total_pages`: Pagination metadata. - `items`: Array of image backup plans with fields:   - `id`, `name`, `description`, `repo_id`   - `config`: Restic backup options (must omit `source_paths`; only `global_options.limit_download` have an impact, `global_options.limit_upload`).   - `extension.partitions`: Map of device index to partition index lists.   - `retention_settings`: Retention limits (`keep_*` and `keep_within_*_as_secs` fields).   - `schedule_enabled`, `schedule_configs`   - `last_executed`: Timestamp of the most recent run.   - `timestamps`: `created_at`, `updated_at`   - `affected_agents`: Agents linked to the plan.   - `pre_script`, `post_script`: Optional scripts (executor, script_path, args, envs, abort_if_fail, script).  ### Example  ```http GET /backup/image/?page=0&per_page=25&repo_id=2783d0b1-d178-499b-ad7b-733670bde27b HTTP/1.1 Authorization: Bearer <access_token> ```  ```json {   \"page\": 0,   \"per_page\": 25,   \"total_items\": 1,   \"total_pages\": 1,   \"items\": [     {       \"id\": \"7b3a9d8a-ea9b-4dc1-9d1e-3cb3104f0d3c\",       \"name\": \"Primary workstation image\",       \"description\": null,       \"repo_id\": \"2783d0b1-d178-499b-ad7b-733670bde27b\",       \"config\": {         \"global_options\": {           \"limit_download\": null,           \"limit_upload\": null         },         \"exclude\": [],         \"exclude_caches\": false,         \"exclude_if_present\": [],         \"exclude_larger_than\": null,         \"iexclude\": []       },       \"extension\": {         \"partitions\": {           \"0\": [0, 1]         }       },       \"retention_settings\": {         \"keep_last\": 3,         \"keep_hourly\": null,         \"keep_daily\": null,         \"keep_weekly\": null,         \"keep_monthly\": null,         \"keep_yearly\": null,         \"keep_within_as_secs\": null,         \"keep_within_hourly_as_secs\": null,         \"keep_within_daily_as_secs\": null,         \"keep_within_weekly_as_secs\": null,         \"keep_within_monthly_as_secs\": null,         \"keep_within_yearly_as_secs\": null       },       \"schedule_enabled\": true,       \"schedule_configs\": [\"b180658b-1799-4563-a5ce-2eb131e51e0e\"],       \"last_executed\": \"2024-05-06T12:00:00Z\",       \"timestamps\": {         \"created_at\": \"2024-05-01T09:12:33Z\",         \"updated_at\": \"2024-05-05T07:15:10Z\"       },       \"affected_agents\": [\"e33602da-cb5f-4b5f-9c49-6307b32cfac7\"],       \"pre_script\": null,       \"post_script\": null     }   ] } ```

        :param page:
        :type page: int
        :param per_page:
        :type per_page: int
        :param order_by:
        :type order_by: List[str]
        :param id:
        :type id: UUID
        :param name:
        :type name: str
        :param repo_id:
        :type repo_id: UUID
        :param schedule_enabled:
        :type schedule_enabled: bool
        :param linked_agents_contains:
        :type linked_agents_contains: List[UUID]
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._list_image_backup_plans_plan_backup_image_get_serialize(
            page=page,
            per_page=per_page,
            order_by=order_by,
            id=id,
            name=name,
            repo_id=repo_id,
            schedule_enabled=schedule_enabled,
            linked_agents_contains=linked_agents_contains,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "PageImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _list_image_backup_plans_plan_backup_image_get_serialize(
        self,
        page,
        per_page,
        order_by,
        id,
        name,
        repo_id,
        schedule_enabled,
        linked_agents_contains,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            "order_by": "multi",
            "linked_agents_contains": "multi",
        }

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if page is not None:
            _query_params.append(("page", page))

        if per_page is not None:
            _query_params.append(("per_page", per_page))

        if order_by is not None:
            _query_params.append(("order_by", order_by))

        if id is not None:
            _query_params.append(("id", id))

        if name is not None:
            _query_params.append(("name", name))

        if repo_id is not None:
            _query_params.append(("repo_id", repo_id))

        if schedule_enabled is not None:
            _query_params.append(("schedule_enabled", schedule_enabled))

        if linked_agents_contains is not None:
            _query_params.append(("linked_agents_contains", linked_agents_contains))

        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/plan/backup/image/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post(
        self,
        plan_id: UUID,
        agent_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Remove Backup Plan Agent


        :param plan_id: (required)
        :type plan_id: UUID
        :param agent_id: (required)
        :type agent_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post_serialize(
            plan_id=plan_id,
            agent_id=agent_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post_with_http_info(
        self,
        plan_id: UUID,
        agent_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Remove Backup Plan Agent


        :param plan_id: (required)
        :type plan_id: UUID
        :param agent_id: (required)
        :type agent_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post_serialize(
            plan_id=plan_id,
            agent_id=agent_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post_without_preload_content(
        self,
        plan_id: UUID,
        agent_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove Backup Plan Agent


        :param plan_id: (required)
        :type plan_id: UUID
        :param agent_id: (required)
        :type agent_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post_serialize(
            plan_id=plan_id,
            agent_id=agent_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _remove_backup_plan_agent_plan_backup_plan_id_remove_agent_agent_id_post_serialize(
        self,
        plan_id,
        agent_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        if agent_id is not None:
            _path_params["agent_id"] = agent_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/{plan_id}/remove-agent/{agent_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post(
        self,
        plan_id: UUID,
        schedule_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> None:
        """Remove Backup Plan Schedule


        :param plan_id: (required)
        :type plan_id: UUID
        :param schedule_id: (required)
        :type schedule_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post_serialize(
            plan_id=plan_id,
            schedule_id=schedule_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post_with_http_info(
        self,
        plan_id: UUID,
        schedule_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[None]:
        """Remove Backup Plan Schedule


        :param plan_id: (required)
        :type plan_id: UUID
        :param schedule_id: (required)
        :type schedule_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post_serialize(
            plan_id=plan_id,
            schedule_id=schedule_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post_without_preload_content(
        self,
        plan_id: UUID,
        schedule_id: UUID,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Remove Backup Plan Schedule


        :param plan_id: (required)
        :type plan_id: UUID
        :param schedule_id: (required)
        :type schedule_id: UUID
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post_serialize(
            plan_id=plan_id,
            schedule_id=schedule_id,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _remove_backup_plan_schedule_plan_backup_plan_id_remove_schedule_schedule_id_post_serialize(
        self,
        plan_id,
        schedule_id,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        if schedule_id is not None:
            _path_params["schedule_id"] = schedule_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/plan/backup/{plan_id}/remove-schedule/{schedule_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def update_file_backup_plans_plan_backup_file_plan_id_put(
        self,
        plan_id: UUID,
        file_backup_plan_update: FileBackupPlanUpdate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> FileBackupPlan:
        """Update File Backup Plans

        # Update file backup plan  Update an existing file backup plan. Fields are optional; only provided values are updated. File plans wrap a backup configuration and must contain at least one absolute `config.source_paths`.  **Endpoint**: `PUT /backup/file/{plan_id}/`  **Auth**: requires an authenticated user.  ## Path parameter - `plan_id` (uuid, required): File backup plan identifier.  ## Request body (FileBackupPlanUpdate) - `name` (string, optional): New plan name. - `description` (string, optional): Updated plan description; must be non-empty if provided. - `repo_id` (uuid, optional): Repository id to target. - `config` (ResticBackup, optional): Updated restic options; must include `source_paths` (absolute paths) if provided. Supports `exclude`, `iexclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, and `global_options.limit_download` / `global_options.limit_upload`. - `schedule_enabled` (bool, optional): Toggle scheduling for the plan. - `retention_settings` (RetentionSettings, optional): Updated retention policy. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Pre/post hooks. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: when `config` is present, `config.source_paths` is mandatory and each path must be absolute. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param plan_id: (required)
        :type plan_id: UUID
        :param file_backup_plan_update: (required)
        :type file_backup_plan_update: FileBackupPlanUpdate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_file_backup_plans_plan_backup_file_plan_id_put_serialize(
            plan_id=plan_id,
            file_backup_plan_update=file_backup_plan_update,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "FileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def update_file_backup_plans_plan_backup_file_plan_id_put_with_http_info(
        self,
        plan_id: UUID,
        file_backup_plan_update: FileBackupPlanUpdate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[FileBackupPlan]:
        """Update File Backup Plans

        # Update file backup plan  Update an existing file backup plan. Fields are optional; only provided values are updated. File plans wrap a backup configuration and must contain at least one absolute `config.source_paths`.  **Endpoint**: `PUT /backup/file/{plan_id}/`  **Auth**: requires an authenticated user.  ## Path parameter - `plan_id` (uuid, required): File backup plan identifier.  ## Request body (FileBackupPlanUpdate) - `name` (string, optional): New plan name. - `description` (string, optional): Updated plan description; must be non-empty if provided. - `repo_id` (uuid, optional): Repository id to target. - `config` (ResticBackup, optional): Updated restic options; must include `source_paths` (absolute paths) if provided. Supports `exclude`, `iexclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, and `global_options.limit_download` / `global_options.limit_upload`. - `schedule_enabled` (bool, optional): Toggle scheduling for the plan. - `retention_settings` (RetentionSettings, optional): Updated retention policy. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Pre/post hooks. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: when `config` is present, `config.source_paths` is mandatory and each path must be absolute. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param plan_id: (required)
        :type plan_id: UUID
        :param file_backup_plan_update: (required)
        :type file_backup_plan_update: FileBackupPlanUpdate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_file_backup_plans_plan_backup_file_plan_id_put_serialize(
            plan_id=plan_id,
            file_backup_plan_update=file_backup_plan_update,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "FileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def update_file_backup_plans_plan_backup_file_plan_id_put_without_preload_content(
        self,
        plan_id: UUID,
        file_backup_plan_update: FileBackupPlanUpdate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update File Backup Plans

        # Update file backup plan  Update an existing file backup plan. Fields are optional; only provided values are updated. File plans wrap a backup configuration and must contain at least one absolute `config.source_paths`.  **Endpoint**: `PUT /backup/file/{plan_id}/`  **Auth**: requires an authenticated user.  ## Path parameter - `plan_id` (uuid, required): File backup plan identifier.  ## Request body (FileBackupPlanUpdate) - `name` (string, optional): New plan name. - `description` (string, optional): Updated plan description; must be non-empty if provided. - `repo_id` (uuid, optional): Repository id to target. - `config` (ResticBackup, optional): Updated restic options; must include `source_paths` (absolute paths) if provided. Supports `exclude`, `iexclude`, `exclude_caches`, `exclude_if_present`, `exclude_larger_than`, and `global_options.limit_download` / `global_options.limit_upload`. - `schedule_enabled` (bool, optional): Toggle scheduling for the plan. - `retention_settings` (RetentionSettings, optional): Updated retention policy. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Pre/post hooks. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: when `config` is present, `config.source_paths` is mandatory and each path must be absolute. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param plan_id: (required)
        :type plan_id: UUID
        :param file_backup_plan_update: (required)
        :type file_backup_plan_update: FileBackupPlanUpdate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_file_backup_plans_plan_backup_file_plan_id_put_serialize(
            plan_id=plan_id,
            file_backup_plan_update=file_backup_plan_update,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "FileBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _update_file_backup_plans_plan_backup_file_plan_id_put_serialize(
        self,
        plan_id,
        file_backup_plan_update,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if file_backup_plan_update is not None:
            _body_params = file_backup_plan_update

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="PUT",
            resource_path="/plan/backup/file/{plan_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def update_image_backup_plans_plan_backup_image_plan_id_put(
        self,
        plan_id: UUID,
        image_backup_plan_update: ImageBackupPlanUpdate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ImageBackupPlan:
        """Update Image Backup Plans

        # Update image backup plan  Update an existing image backup plan. Fields are optional; only provided values are updated. Image plans wrap restic backup configuration and must NOT include `config.source_paths` when `config` is supplied.  **Endpoint**: `PUT /backup/image/{plan_id}/` **Auth**: requires an authenticated Zitadel user; the gateway forwards `Cbe-User-*` headers to the backup manager.  ## Path parameter - `plan_id` (uuid, required): Image backup plan identifier.  ## Request body (ImageBackupPlanUpdate) - `name` (string, optional): New plan name. - `description` (string, optional): Updated plan description; must be non-empty if provided. - `repo_id` (uuid, optional): Target repository id. - `config` (ResticBackup, optional): Updated restic options; must omit `source_paths`. Only `global_options.limit_download` / `global_options.limit_upload` have an impact. - `schedule_enabled` (bool, optional): Toggle scheduling for the plan. - `extension` (ImageBackupPlanExtension, optional): Updated partitions map to backup, e.g. `{ \"partitions\": { \"Disk0\": [0,1] } }`. - `retention_settings` (RetentionSettings, optional): Updated retention policy. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Pre/post hooks. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: when `config` is present, `config.source_paths` must be absent. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param plan_id: (required)
        :type plan_id: UUID
        :param image_backup_plan_update: (required)
        :type image_backup_plan_update: ImageBackupPlanUpdate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_image_backup_plans_plan_backup_image_plan_id_put_serialize(
            plan_id=plan_id,
            image_backup_plan_update=image_backup_plan_update,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def update_image_backup_plans_plan_backup_image_plan_id_put_with_http_info(
        self,
        plan_id: UUID,
        image_backup_plan_update: ImageBackupPlanUpdate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[ImageBackupPlan]:
        """Update Image Backup Plans

        # Update image backup plan  Update an existing image backup plan. Fields are optional; only provided values are updated. Image plans wrap restic backup configuration and must NOT include `config.source_paths` when `config` is supplied.  **Endpoint**: `PUT /backup/image/{plan_id}/` **Auth**: requires an authenticated Zitadel user; the gateway forwards `Cbe-User-*` headers to the backup manager.  ## Path parameter - `plan_id` (uuid, required): Image backup plan identifier.  ## Request body (ImageBackupPlanUpdate) - `name` (string, optional): New plan name. - `description` (string, optional): Updated plan description; must be non-empty if provided. - `repo_id` (uuid, optional): Target repository id. - `config` (ResticBackup, optional): Updated restic options; must omit `source_paths`. Only `global_options.limit_download` / `global_options.limit_upload` have an impact. - `schedule_enabled` (bool, optional): Toggle scheduling for the plan. - `extension` (ImageBackupPlanExtension, optional): Updated partitions map to backup, e.g. `{ \"partitions\": { \"Disk0\": [0,1] } }`. - `retention_settings` (RetentionSettings, optional): Updated retention policy. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Pre/post hooks. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: when `config` is present, `config.source_paths` must be absent. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param plan_id: (required)
        :type plan_id: UUID
        :param image_backup_plan_update: (required)
        :type image_backup_plan_update: ImageBackupPlanUpdate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_image_backup_plans_plan_backup_image_plan_id_put_serialize(
            plan_id=plan_id,
            image_backup_plan_update=image_backup_plan_update,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def update_image_backup_plans_plan_backup_image_plan_id_put_without_preload_content(
        self,
        plan_id: UUID,
        image_backup_plan_update: ImageBackupPlanUpdate,
        cbe_user_org_id: Annotated[
            Optional[Annotated[str, Field(strict=True, max_length=20)]],
            Field(
                description=" Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/` "
            ),
        ] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Update Image Backup Plans

        # Update image backup plan  Update an existing image backup plan. Fields are optional; only provided values are updated. Image plans wrap restic backup configuration and must NOT include `config.source_paths` when `config` is supplied.  **Endpoint**: `PUT /backup/image/{plan_id}/` **Auth**: requires an authenticated Zitadel user; the gateway forwards `Cbe-User-*` headers to the backup manager.  ## Path parameter - `plan_id` (uuid, required): Image backup plan identifier.  ## Request body (ImageBackupPlanUpdate) - `name` (string, optional): New plan name. - `description` (string, optional): Updated plan description; must be non-empty if provided. - `repo_id` (uuid, optional): Target repository id. - `config` (ResticBackup, optional): Updated restic options; must omit `source_paths`. Only `global_options.limit_download` / `global_options.limit_upload` have an impact. - `schedule_enabled` (bool, optional): Toggle scheduling for the plan. - `extension` (ImageBackupPlanExtension, optional): Updated partitions map to backup, e.g. `{ \"partitions\": { \"Disk0\": [0,1] } }`. - `retention_settings` (RetentionSettings, optional): Updated retention policy. Supports `keep_last`, `keep_hourly`, `keep_daily`, `keep_weekly`, `keep_monthly`, `keep_yearly`, and `keep_within_*_as_secs` variants. - `pre_script`, `post_script` (PrePostRunScript, optional): Pre/post hooks. Fields: `executor`, `script_path`, `args`, `envs`, `abort_if_fail`, optional inline `script`.  Validation highlights: when `config` is present, `config.source_paths` must be absent. If `pre_script`/`post_script` are provided, they must include an executor and script path.

        :param plan_id: (required)
        :type plan_id: UUID
        :param image_backup_plan_update: (required)
        :type image_backup_plan_update: ImageBackupPlanUpdate
        :param cbe_user_org_id:  Organization ID to request against. Can be empty (uses the user's org), a specific ID, or an asterisk (*) in which case the returned data are sourced from all orgs you can access.  See `/identity/organization/`
        :type cbe_user_org_id: str
        :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
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._update_image_backup_plans_plan_backup_image_plan_id_put_serialize(
            plan_id=plan_id,
            image_backup_plan_update=image_backup_plan_update,
            cbe_user_org_id=cbe_user_org_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "ImageBackupPlan",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _update_image_backup_plans_plan_backup_image_plan_id_put_serialize(
        self,
        plan_id,
        image_backup_plan_update,
        cbe_user_org_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {}

        _path_params: Dict[str, str] = {}
        _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, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if plan_id is not None:
            _path_params["plan_id"] = plan_id
        # process the query parameters
        # process the header parameters
        if cbe_user_org_id is not None:
            _header_params["cbe-user-org-id"] = cbe_user_org_id
        # process the form parameters
        # process the body parameter
        if image_backup_plan_update is not None:
            _body_params = image_backup_plan_update

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["ZitadelWebAuthorizationBearer", "BearerToken"]

        return self.api_client.param_serialize(
            method="PUT",
            resource_path="/plan/backup/image/{plan_id}/",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )
