# coding: utf-8

"""
    BioT Settings Service

    APIs document description for Settings service

    The version of the OpenAPI document: 2.44.1
    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 pydantic import Field
from typing import Optional
from typing_extensions import Annotated
from biotmed_settings_sdk.models.backup_request import BackupRequest
from biotmed_settings_sdk.models.backup_response import BackupResponse
from biotmed_settings_sdk.models.search_request_v2 import SearchRequestV2
from biotmed_settings_sdk.models.search_response_backup_response import SearchResponseBackupResponse
from biotmed_settings_sdk.models.search_response_restore_response import SearchResponseRestoreResponse

from biotmed_settings_sdk.api_client import ApiClient, RequestSerialized
from biotmed_settings_sdk.api_response import ApiResponse
from biotmed_settings_sdk.rest import RESTResponseType


class BackupAPIApi:
    """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 backup(
        self,
        backup_request: BackupRequest,
        _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,
    ) -> BackupResponse:
        """Backup

        Backup    This backup will be saved in an S3 bucket in AWS. The name parameter in the request will be the folder the backup is saved in the s3 bucket. The full path in which it will be saved is s3://<account-id>-backup/<backup-biot-version>/<name-from-request> E.g. for customer id 123456, biot version 2.3.11 and backup name backup1, the backup will be saved in the s3 path s3://123456-backup/2.3.11/backup1  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |name|string|true|The name of the backup, it will also be the folder in which the backup is saved|Backup-01-02-2024| |description|string|false|The description of the backup|Backup after entity creation|   This API requires **SETTINGS_START_BACKUP** permission(s).  

        :param backup_request: (required)
        :type backup_request: BackupRequest
        :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._backup_serialize(
            backup_request=backup_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '201': "BackupResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 backup_with_http_info(
        self,
        backup_request: BackupRequest,
        _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[BackupResponse]:
        """Backup

        Backup    This backup will be saved in an S3 bucket in AWS. The name parameter in the request will be the folder the backup is saved in the s3 bucket. The full path in which it will be saved is s3://<account-id>-backup/<backup-biot-version>/<name-from-request> E.g. for customer id 123456, biot version 2.3.11 and backup name backup1, the backup will be saved in the s3 path s3://123456-backup/2.3.11/backup1  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |name|string|true|The name of the backup, it will also be the folder in which the backup is saved|Backup-01-02-2024| |description|string|false|The description of the backup|Backup after entity creation|   This API requires **SETTINGS_START_BACKUP** permission(s).  

        :param backup_request: (required)
        :type backup_request: BackupRequest
        :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._backup_serialize(
            backup_request=backup_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '201': "BackupResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 backup_without_preload_content(
        self,
        backup_request: BackupRequest,
        _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:
        """Backup

        Backup    This backup will be saved in an S3 bucket in AWS. The name parameter in the request will be the folder the backup is saved in the s3 bucket. The full path in which it will be saved is s3://<account-id>-backup/<backup-biot-version>/<name-from-request> E.g. for customer id 123456, biot version 2.3.11 and backup name backup1, the backup will be saved in the s3 path s3://123456-backup/2.3.11/backup1  Request Body Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |name|string|true|The name of the backup, it will also be the folder in which the backup is saved|Backup-01-02-2024| |description|string|false|The description of the backup|Backup after entity creation|   This API requires **SETTINGS_START_BACKUP** permission(s).  

        :param backup_request: (required)
        :type backup_request: BackupRequest
        :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._backup_serialize(
            backup_request=backup_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '201': "BackupResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _backup_serialize(
        self,
        backup_request,
        _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
        # process the form parameters
        # process the body parameter
        if backup_request is not None:
            _body_params = backup_request


        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/system/backup',
            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 search_backup_executions(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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,
    ) -> SearchResponseBackupResponse:
        """Search Backup entities by filter

        Search Backup entities by filter  Returns list of Backup, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *name*,*description*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *name*,*description*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_BACKUPS** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search_backup_executions_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseBackupResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 search_backup_executions_with_http_info(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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[SearchResponseBackupResponse]:
        """Search Backup entities by filter

        Search Backup entities by filter  Returns list of Backup, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *name*,*description*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *name*,*description*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_BACKUPS** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search_backup_executions_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseBackupResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 search_backup_executions_without_preload_content(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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:
        """Search Backup entities by filter

        Search Backup entities by filter  Returns list of Backup, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *name*,*description*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *name*,*description*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_BACKUPS** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search_backup_executions_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseBackupResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _search_backup_executions_serialize(
        self,
        search_request,
        _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
        if search_request is not None:
            
            _query_params.append(('searchRequest', search_request))
            
        # process the header parameters
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/system/backup/executions',
            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 search_restore_executions(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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,
    ) -> SearchResponseRestoreResponse:
        """Search Restore entities by filter

        Search Restore entities by filter  Returns list of Restore, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *name*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *name*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_RESTORES** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search_restore_executions_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseRestoreResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 search_restore_executions_with_http_info(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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[SearchResponseRestoreResponse]:
        """Search Restore entities by filter

        Search Restore entities by filter  Returns list of Restore, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *name*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *name*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_RESTORES** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search_restore_executions_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseRestoreResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        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 search_restore_executions_without_preload_content(
        self,
        search_request: Annotated[Optional[SearchRequestV2], Field(description="Search request parameters: filter, sort and page")] = 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:
        """Search Restore entities by filter

        Search Restore entities by filter  Returns list of Restore, the response can be filtered, sorted and supports pagination   **For more information and examples on creating search requests, click <a href=\"https://docs.biot-med.com/docs/using-biot-search-apis\" target=\"_blank\">here.</a>** ## Filter Each additionalProp can filter one field, inside additionalProp there are many optional conditions that can be used for filtering that field  By using the logical additionalProps $AND, $OR, $NOT, you can add complex nested logic filters. When sending these props, you must send only the nested filter field inside the filter value. This will allow you to group additional filters using logical AND/OR/NOT operators. When not sending a logic prop (including when not sending a nested logic prop), the props are bundled together using logical AND operators, this means that only the items that match all filter conditions for that field will be returned.  ***filter*** items possible values: [ *name*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]   ## Sort Results can be sorted by multiple fields, the order of the fields in the sort request governs the hierarchy of the sort  The first field is the primary sort, the second is used when two values of the first field are the same, and so forth  ***sort.order*** default value is DESC  ***sort.prop*** possible values:[ *name*,*backupVersion*,*buildNumber*,*errorMessage*,*status*,*creationTime*,*lastModifiedTime* ]  If sort was not specified, the result will be sorted by: creationTime DESC  ## Free text search When freeTextSearch is passed, the free text search will be performed on every field except those of type Date  If used together with filters, freeTextSearch will be bundled to the filters with the logical AND operator, this means that only items that match all filters (and each filter's conditions) and the free text search will be returned  ## Page ***limit*** max number of results that will be returned for each page. If not specify, the default will be 100  ***page*** page number starting from 0. If not specify, the default will be 0  ## Build URL Encode the JSON object and use the encoded string as the searchRequest parameter:  https://&lt;URL&gt;?searchRequest=<ENCODED_JSON_STRING>  Query Parameters:  | Parameter   |Type   | Mandatory| Description          | Example   | |-------------|-------|----------|----------------------|-----------| |searchRequest||false|Search request parameters: filter, sort and page||   This API requires **SETTINGS_SEARCH_RESTORES** permission(s).  

        :param search_request: Search request parameters: filter, sort and page
        :type search_request: SearchRequestV2
        :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._search_restore_executions_serialize(
            search_request=search_request,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '400': "ErrorResponse",
            '200': "SearchResponseRestoreResponse",
            '500': "ErrorResponse",
            '401': "ErrorResponse",
            '403': "ErrorResponse",
            '504': "ErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _search_restore_executions_serialize(
        self,
        search_request,
        _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
        if search_request is not None:
            
            _query_params.append(('searchRequest', search_request))
            
        # process the header parameters
        # 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] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/system/restore/executions',
            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
        )


