# coding: utf-8

"""
    Kestra EE

    All API operations, except for Superadmin-only endpoints, require a tenant identifier in the HTTP path.<br/> Endpoints designated as Superadmin-only are not tenant-scoped.

    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501
# Custom imports
import requests
import sseclient
import json
from typing import Generator


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, StrictBool, StrictStr
from typing import Any, Dict, List, Optional
from typing_extensions import Annotated
from kestrapy.models.delete_triggers_by_query_request import DeleteTriggersByQueryRequest
from kestrapy.models.paged_results_trigger import PagedResultsTrigger
from kestrapy.models.paged_results_trigger_controller_triggers import PagedResultsTriggerControllerTriggers
from kestrapy.models.query_filter import QueryFilter
from kestrapy.models.trigger import Trigger
from kestrapy.models.trigger_controller_set_disabled_request import TriggerControllerSetDisabledRequest

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


class TriggersApi:
    """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 delete_backfill(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> Trigger:
        """Delete a backfill


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._delete_backfill_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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_backfill_with_http_info(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[Trigger]:
        """Delete a backfill


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._delete_backfill_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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,
        )


    def _delete_backfill_serialize(
        self,
        tenant,
        trigger,
    ) -> 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]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/delete',
            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
        )





    @validate_call
    def delete_backfill_by_ids(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Delete backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._delete_backfill_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_backfill_by_ids_with_http_info(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Delete backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._delete_backfill_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _delete_backfill_by_ids_serialize(
        self,
        tenant,
        trigger,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'Trigger': '',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/delete/by-triggers',
            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
        )





    @validate_call
    def delete_backfill_by_query(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Delete backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._delete_backfill_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_backfill_by_query_with_http_info(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Delete backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._delete_backfill_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _delete_backfill_by_query_serialize(
        self,
        tenant,
        filters,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/delete/by-query',
            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
        )





    @validate_call
    def delete_trigger(
        self,
        namespace: Annotated[StrictStr, Field(description="The namespace")],
        flow_id: Annotated[StrictStr, Field(description="The flow id")],
        trigger_id: Annotated[StrictStr, Field(description="The trigger id")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Delete a trigger


        :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param trigger_id: The trigger id (required)
        :type trigger_id: str
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._delete_trigger_serialize(
            namespace=namespace,
            flow_id=flow_id,
            trigger_id=trigger_id,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_trigger_with_http_info(
        self,
        namespace: Annotated[StrictStr, Field(description="The namespace")],
        flow_id: Annotated[StrictStr, Field(description="The flow id")],
        trigger_id: Annotated[StrictStr, Field(description="The trigger id")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Delete a trigger


        :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param trigger_id: The trigger id (required)
        :type trigger_id: str
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._delete_trigger_serialize(
            namespace=namespace,
            flow_id=flow_id,
            trigger_id=trigger_id,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _delete_trigger_serialize(
        self,
        namespace,
        flow_id,
        trigger_id,
        tenant,
    ) -> 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]] = {}
        _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 namespace is not None:
            _path_params['namespace'] = namespace
        if flow_id is not None:
            _path_params['flowId'] = flow_id
        if trigger_id is not None:
            _path_params['triggerId'] = trigger_id
        if tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/api/v1/{tenant}/triggers/{namespace}/{flowId}/{triggerId}',
            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
        )





    @validate_call
    def delete_triggers_by_ids(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Delete given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._delete_triggers_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_triggers_by_ids_with_http_info(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Delete given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._delete_triggers_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _delete_triggers_by_ids_serialize(
        self,
        tenant,
        trigger,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'Trigger': '',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/api/v1/{tenant}/triggers/delete/by-triggers',
            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
        )





    @validate_call
    def delete_triggers_by_query(
        self,
        tenant: StrictStr,
        delete_triggers_by_query_request: DeleteTriggersByQueryRequest,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Delete triggers by query parameters


        :param tenant: (required)
        :type tenant: str
                :param delete_triggers_by_query_request: (required)
        :type delete_triggers_by_query_request: DeleteTriggersByQueryRequest
        ,
        :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
        """ # noqa: E501

        _param = self._delete_triggers_by_query_serialize(
            tenant=tenant,
            delete_triggers_by_query_request=delete_triggers_by_query_request,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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_triggers_by_query_with_http_info(
        self,
        tenant: StrictStr,
        delete_triggers_by_query_request: DeleteTriggersByQueryRequest,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Delete triggers by query parameters


        :param tenant: (required)
        :type tenant: str
                :param delete_triggers_by_query_request: (required)
        :type delete_triggers_by_query_request: DeleteTriggersByQueryRequest
        ,
        :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
        """ # noqa: E501

        _param = self._delete_triggers_by_query_serialize(
            tenant=tenant,
            delete_triggers_by_query_request=delete_triggers_by_query_request,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _delete_triggers_by_query_serialize(
        self,
        tenant,
        delete_triggers_by_query_request,
    ) -> 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]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if delete_triggers_by_query_request is not None:
            _body_params = delete_triggers_by_query_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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/api/v1/{tenant}/triggers/delete/by-query',
            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
        )





    @validate_call
    def disabled_triggers_by_ids(
        self,
        tenant: StrictStr,
        trigger_controller_set_disabled_request: TriggerControllerSetDisabledRequest,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Disable/enable given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger_controller_set_disabled_request: (required)
        :type trigger_controller_set_disabled_request: TriggerControllerSetDisabledRequest
        ,
        :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
        """ # noqa: E501

        _param = self._disabled_triggers_by_ids_serialize(
            tenant=tenant,
            trigger_controller_set_disabled_request=trigger_controller_set_disabled_request,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 disabled_triggers_by_ids_with_http_info(
        self,
        tenant: StrictStr,
        trigger_controller_set_disabled_request: TriggerControllerSetDisabledRequest,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Disable/enable given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger_controller_set_disabled_request: (required)
        :type trigger_controller_set_disabled_request: TriggerControllerSetDisabledRequest
        ,
        :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
        """ # noqa: E501

        _param = self._disabled_triggers_by_ids_serialize(
            tenant=tenant,
            trigger_controller_set_disabled_request=trigger_controller_set_disabled_request,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _disabled_triggers_by_ids_serialize(
        self,
        tenant,
        trigger_controller_set_disabled_request,
    ) -> 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]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger_controller_set_disabled_request is not None:
            _body_params = trigger_controller_set_disabled_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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/set-disabled/by-triggers',
            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
        )





    @validate_call
    def disabled_triggers_by_query(
        self,
        disabled: Annotated[StrictBool, Field(description="The disabled state")],
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Disable/enable triggers by query parameters


        :param disabled: The disabled state (required)
        :type disabled: bool
                :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._disabled_triggers_by_query_serialize(
            disabled=disabled,
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 disabled_triggers_by_query_with_http_info(
        self,
        disabled: Annotated[StrictBool, Field(description="The disabled state")],
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Disable/enable triggers by query parameters


        :param disabled: The disabled state (required)
        :type disabled: bool
                :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._disabled_triggers_by_query_serialize(
            disabled=disabled,
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _disabled_triggers_by_query_serialize(
        self,
        disabled,
        tenant,
        filters,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        if disabled is not None:
            
            _query_params.append(('disabled', disabled))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/set-disabled/by-query',
            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
        )





    @validate_call
    def export_triggers(
        self,
        filters: Annotated[List[QueryFilter], Field(description="A list of filters")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> List[object]:
        """Export all triggers as a streamed CSV file


        :param filters: A list of filters (required)
        :type filters: List[QueryFilter]
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._export_triggers_serialize(
            filters=filters,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[object]",
        }
        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 export_triggers_with_http_info(
        self,
        filters: Annotated[List[QueryFilter], Field(description="A list of filters")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[List[object]]:
        """Export all triggers as a streamed CSV file


        :param filters: A list of filters (required)
        :type filters: List[QueryFilter]
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._export_triggers_serialize(
            filters=filters,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[object]",
        }
        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,
        )


    def _export_triggers_serialize(
        self,
        filters,
        tenant,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        # 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(
                [
                    'text/csv'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/{tenant}/triggers/export/by-query/csv',
            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
        )





    @validate_call
    def pause_backfill(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> Trigger:
        """Pause a backfill


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._pause_backfill_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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 pause_backfill_with_http_info(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[Trigger]:
        """Pause a backfill


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._pause_backfill_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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,
        )


    def _pause_backfill_serialize(
        self,
        tenant,
        trigger,
    ) -> 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]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/api/v1/{tenant}/triggers/backfill/pause',
            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
        )





    @validate_call
    def pause_backfill_by_ids(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Pause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._pause_backfill_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 pause_backfill_by_ids_with_http_info(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Pause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._pause_backfill_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _pause_backfill_by_ids_serialize(
        self,
        tenant,
        trigger,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'Trigger': '',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/pause/by-triggers',
            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
        )





    @validate_call
    def pause_backfill_by_query(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Pause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._pause_backfill_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 pause_backfill_by_query_with_http_info(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Pause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._pause_backfill_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _pause_backfill_by_query_serialize(
        self,
        tenant,
        filters,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/pause/by-query',
            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
        )





    @validate_call
    def restart_trigger(
        self,
        namespace: Annotated[StrictStr, Field(description="The namespace")],
        flow_id: Annotated[StrictStr, Field(description="The flow id")],
        trigger_id: Annotated[StrictStr, Field(description="The trigger id")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Restart a trigger


        :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param trigger_id: The trigger id (required)
        :type trigger_id: str
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._restart_trigger_serialize(
            namespace=namespace,
            flow_id=flow_id,
            trigger_id=trigger_id,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 restart_trigger_with_http_info(
        self,
        namespace: Annotated[StrictStr, Field(description="The namespace")],
        flow_id: Annotated[StrictStr, Field(description="The flow id")],
        trigger_id: Annotated[StrictStr, Field(description="The trigger id")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Restart a trigger


        :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param trigger_id: The trigger id (required)
        :type trigger_id: str
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._restart_trigger_serialize(
            namespace=namespace,
            flow_id=flow_id,
            trigger_id=trigger_id,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _restart_trigger_serialize(
        self,
        namespace,
        flow_id,
        trigger_id,
        tenant,
    ) -> 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]] = {}
        _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 namespace is not None:
            _path_params['namespace'] = namespace
        if flow_id is not None:
            _path_params['flowId'] = flow_id
        if trigger_id is not None:
            _path_params['triggerId'] = trigger_id
        if tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/{namespace}/{flowId}/{triggerId}/restart',
            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
        )





    @validate_call
    def search_triggers(
        self,
        page: Annotated[int, Field(strict=True, ge=1, description="The current page")],
        size: Annotated[int, Field(strict=True, ge=1, description="The current page size")],
        tenant: StrictStr,
        sort: Annotated[Optional[List[StrictStr]], Field(description="The sort of current page")] = None,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> PagedResultsTriggerControllerTriggers:
        """Search for triggers


        :param page: The current page (required)
        :type page: int
                :param size: The current page size (required)
        :type size: int
                :param tenant: (required)
        :type tenant: str
                :param sort: The sort of current page
        :type sort: List[str]
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._search_triggers_serialize(
            page=page,
            size=size,
            tenant=tenant,
            sort=sort,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PagedResultsTriggerControllerTriggers",
        }
        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_triggers_with_http_info(
        self,
        page: Annotated[int, Field(strict=True, ge=1, description="The current page")],
        size: Annotated[int, Field(strict=True, ge=1, description="The current page size")],
        tenant: StrictStr,
        sort: Annotated[Optional[List[StrictStr]], Field(description="The sort of current page")] = None,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[PagedResultsTriggerControllerTriggers]:
        """Search for triggers


        :param page: The current page (required)
        :type page: int
                :param size: The current page size (required)
        :type size: int
                :param tenant: (required)
        :type tenant: str
                :param sort: The sort of current page
        :type sort: List[str]
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._search_triggers_serialize(
            page=page,
            size=size,
            tenant=tenant,
            sort=sort,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PagedResultsTriggerControllerTriggers",
        }
        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,
        )


    def _search_triggers_serialize(
        self,
        page,
        size,
        tenant,
        sort,
        filters,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'sort': 'csv',
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if page is not None:
            
            _query_params.append(('page', page))
            
        if size is not None:
            
            _query_params.append(('size', size))
            
        if sort is not None:
            
            _query_params.append(('sort', sort))
            
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/{tenant}/triggers/search',
            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
        )





    @validate_call
    def search_triggers_for_flow(
        self,
        page: Annotated[int, Field(strict=True, ge=1, description="The current page")],
        size: Annotated[int, Field(strict=True, ge=1, description="The current page size")],
        namespace: Annotated[Optional[StrictStr], Field(description="The namespace")],
        flow_id: Annotated[Optional[StrictStr], Field(description="The flow id")],
        tenant: StrictStr,
        sort: Annotated[Optional[List[StrictStr]], Field(description="The sort of current page")] = None,
        q: Annotated[Optional[StrictStr], Field(description="A string filter")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> PagedResultsTrigger:
        """Get all triggers for a flow


        :param page: The current page (required)
        :type page: int
                :param size: The current page size (required)
        :type size: int
                :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param tenant: (required)
        :type tenant: str
                :param sort: The sort of current page
        :type sort: List[str]
                :param q: A string filter
        :type q: 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
        """ # noqa: E501

        _param = self._search_triggers_for_flow_serialize(
            page=page,
            size=size,
            namespace=namespace,
            flow_id=flow_id,
            tenant=tenant,
            sort=sort,
            q=q,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PagedResultsTrigger",
        }
        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_triggers_for_flow_with_http_info(
        self,
        page: Annotated[int, Field(strict=True, ge=1, description="The current page")],
        size: Annotated[int, Field(strict=True, ge=1, description="The current page size")],
        namespace: Annotated[Optional[StrictStr], Field(description="The namespace")],
        flow_id: Annotated[Optional[StrictStr], Field(description="The flow id")],
        tenant: StrictStr,
        sort: Annotated[Optional[List[StrictStr]], Field(description="The sort of current page")] = None,
        q: Annotated[Optional[StrictStr], Field(description="A string filter")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[PagedResultsTrigger]:
        """Get all triggers for a flow


        :param page: The current page (required)
        :type page: int
                :param size: The current page size (required)
        :type size: int
                :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param tenant: (required)
        :type tenant: str
                :param sort: The sort of current page
        :type sort: List[str]
                :param q: A string filter
        :type q: 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
        """ # noqa: E501

        _param = self._search_triggers_for_flow_serialize(
            page=page,
            size=size,
            namespace=namespace,
            flow_id=flow_id,
            tenant=tenant,
            sort=sort,
            q=q,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PagedResultsTrigger",
        }
        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,
        )


    def _search_triggers_for_flow_serialize(
        self,
        page,
        size,
        namespace,
        flow_id,
        tenant,
        sort,
        q,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'sort': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 namespace is not None:
            _path_params['namespace'] = namespace
        if flow_id is not None:
            _path_params['flowId'] = flow_id
        if tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if page is not None:
            
            _query_params.append(('page', page))
            
        if size is not None:
            
            _query_params.append(('size', size))
            
        if sort is not None:
            
            _query_params.append(('sort', sort))
            
        if q is not None:
            
            _query_params.append(('q', q))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/v1/{tenant}/triggers/{namespace}/{flowId}',
            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
        )





    @validate_call
    def unlock_trigger(
        self,
        namespace: Annotated[StrictStr, Field(description="The namespace")],
        flow_id: Annotated[StrictStr, Field(description="The flow id")],
        trigger_id: Annotated[StrictStr, Field(description="The trigger id")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> Trigger:
        """Unlock a trigger


        :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param trigger_id: The trigger id (required)
        :type trigger_id: str
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._unlock_trigger_serialize(
            namespace=namespace,
            flow_id=flow_id,
            trigger_id=trigger_id,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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 unlock_trigger_with_http_info(
        self,
        namespace: Annotated[StrictStr, Field(description="The namespace")],
        flow_id: Annotated[StrictStr, Field(description="The flow id")],
        trigger_id: Annotated[StrictStr, Field(description="The trigger id")],
        tenant: StrictStr,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[Trigger]:
        """Unlock a trigger


        :param namespace: The namespace (required)
        :type namespace: str
                :param flow_id: The flow id (required)
        :type flow_id: str
                :param trigger_id: The trigger id (required)
        :type trigger_id: str
                :param tenant: (required)
        :type tenant: 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
        """ # noqa: E501

        _param = self._unlock_trigger_serialize(
            namespace=namespace,
            flow_id=flow_id,
            trigger_id=trigger_id,
            tenant=tenant,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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,
        )


    def _unlock_trigger_serialize(
        self,
        namespace,
        flow_id,
        trigger_id,
        tenant,
    ) -> 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]] = {}
        _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 namespace is not None:
            _path_params['namespace'] = namespace
        if flow_id is not None:
            _path_params['flowId'] = flow_id
        if trigger_id is not None:
            _path_params['triggerId'] = trigger_id
        if tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/{namespace}/{flowId}/{triggerId}/unlock',
            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
        )





    @validate_call
    def unlock_triggers_by_ids(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Unlock given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._unlock_triggers_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 unlock_triggers_by_ids_with_http_info(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Unlock given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._unlock_triggers_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _unlock_triggers_by_ids_serialize(
        self,
        tenant,
        trigger,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'Trigger': '',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/unlock/by-triggers',
            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
        )





    @validate_call
    def unlock_triggers_by_query(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Unlock triggers by query parameters


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._unlock_triggers_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 unlock_triggers_by_query_with_http_info(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Unlock triggers by query parameters


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._unlock_triggers_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _unlock_triggers_by_query_serialize(
        self,
        tenant,
        filters,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/unlock/by-query',
            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
        )





    @validate_call
    def unpause_backfill(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> Trigger:
        """Unpause a backfill


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._unpause_backfill_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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 unpause_backfill_with_http_info(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[Trigger]:
        """Unpause a backfill


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._unpause_backfill_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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,
        )


    def _unpause_backfill_serialize(
        self,
        tenant,
        trigger,
    ) -> 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]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/api/v1/{tenant}/triggers/backfill/unpause',
            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
        )





    @validate_call
    def unpause_backfill_by_ids(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Unpause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._unpause_backfill_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 unpause_backfill_by_ids_with_http_info(
        self,
        tenant: StrictStr,
        trigger: List[Trigger],
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Unpause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: List[Trigger]
        ,
        :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
        """ # noqa: E501

        _param = self._unpause_backfill_by_ids_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _unpause_backfill_by_ids_serialize(
        self,
        tenant,
        trigger,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'Trigger': '',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/unpause/by-triggers',
            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
        )





    @validate_call
    def unpause_backfill_by_query(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> object:
        """Unpause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._unpause_backfill_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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 unpause_backfill_by_query_with_http_info(
        self,
        tenant: StrictStr,
        filters: Annotated[Optional[List[QueryFilter]], Field(description="Filters")] = None,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[object]:
        """Unpause backfill for given triggers


        :param tenant: (required)
        :type tenant: str
                :param filters: Filters
        :type filters: List[QueryFilter]
        ,
        :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
        """ # noqa: E501

        _param = self._unpause_backfill_by_query_serialize(
            tenant=tenant,
            filters=filters,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "object",
        }
        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,
        )


    def _unpause_backfill_by_query_serialize(
        self,
        tenant,
        filters,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'filters': 'csv',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        if filters is not None:
            
            _query_params.append(('filters', filters))
            
        # 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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/api/v1/{tenant}/triggers/backfill/unpause/by-query',
            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
        )





    @validate_call
    def update_trigger(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> Trigger:
        """Update a trigger


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._update_trigger_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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_trigger_with_http_info(
        self,
        tenant: StrictStr,
        trigger: Trigger,
        _request_timeout: Union[
        None,
        Annotated[StrictFloat, Field(gt=0)],
        Tuple[
        Annotated[StrictFloat, Field(gt=0)],
        Annotated[StrictFloat, Field(gt=0)]
        ]
        ] = None
    ) -> ApiResponse[Trigger]:
        """Update a trigger


        :param tenant: (required)
        :type tenant: str
                :param trigger: (required)
        :type trigger: Trigger
        ,
        :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
        """ # noqa: E501

        _param = self._update_trigger_serialize(
            tenant=tenant,
            trigger=trigger,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "Trigger",
        }
        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,
        )


    def _update_trigger_serialize(
        self,
        tenant,
        trigger,
    ) -> 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]] = {}
        _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 tenant is not None:
            _path_params['tenant'] = tenant
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if trigger is not None:
            _body_params = trigger



        # 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`

        _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] = [
            'basicAuth', 
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/api/v1/{tenant}/triggers',
            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
        )




