# coding: utf-8

"""
    Instana REST API documentation

    Documentation for INSTANA REST API

    The version of the OpenAPI document: 1.309.1268
    Contact: support@instana.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

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

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

from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator
from typing import List, Optional
from typing_extensions import Annotated
from instana_client.models.event_result import EventResult

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


class EventsApi:
    """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 agent_monitoring_events(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[EventResult]:
        """Get Agent Monitoring Events

        Gets all Agent Monitoring Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._agent_monitoring_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '404': None,
        }
        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 agent_monitoring_events_with_http_info(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[EventResult]]:
        """Get Agent Monitoring Events

        Gets all Agent Monitoring Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._agent_monitoring_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def agent_monitoring_events_without_preload_content(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Agent Monitoring Events

        Gets all Agent Monitoring Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._agent_monitoring_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _agent_monitoring_events_serialize(
        self,
        to,
        window_size,
        var_from,
        filter_event_updates,
        exclude_triggered_before,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if to is not None:
            
            _query_params.append(('to', to))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if var_from is not None:
            
            _query_params.append(('from', var_from))
            
        if filter_event_updates is not None:
            
            _query_params.append(('filterEventUpdates', filter_event_updates))
            
        if exclude_triggered_before is not None:
            
            _query_params.append(('excludeTriggeredBefore', exclude_triggered_before))
            
        # 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] = [
            'ApiKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/events/agent-monitoring-events',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_event(
        self,
        event_id: Annotated[StrictStr, Field(description="ID of a specific Event to retrieve.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> EventResult:
        """Get Event

        Gets a specific event.

        :param event_id: ID of a specific Event to retrieve. (required)
        :type event_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_event_serialize(
            event_id=event_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def get_event_with_http_info(
        self,
        event_id: Annotated[StrictStr, Field(description="ID of a specific Event to retrieve.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[EventResult]:
        """Get Event

        Gets a specific event.

        :param event_id: ID of a specific Event to retrieve. (required)
        :type event_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_event_serialize(
            event_id=event_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EventResult",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_event_without_preload_content(
        self,
        event_id: Annotated[StrictStr, Field(description="ID of a specific Event to retrieve.")],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Event

        Gets a specific event.

        :param event_id: ID of a specific Event to retrieve. (required)
        :type event_id: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_event_serialize(
            event_id=event_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "EventResult",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_event_serialize(
        self,
        event_id,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if event_id is not None:
            _path_params['eventId'] = event_id
        # 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] = [
            'ApiKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/events/{eventId}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_events(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        include_agent_monitoring_issues: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to include Agent Monitoring Issues.")] = None,
        include_kubernetes_info_events: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to include Kubernetes Info Events.")] = None,
        event_type_filters: Annotated[Optional[List[StrictStr]], Field(description="A string representing an event type - an INCIDENT, ISSUE, or CHANGE. This query can be repeated to use multiple filters.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[EventResult]:
        """Get all Events

        Get all Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param include_agent_monitoring_issues: Flag to filter the results to include Agent Monitoring Issues.
        :type include_agent_monitoring_issues: bool
        :param include_kubernetes_info_events: Flag to filter the results to include Kubernetes Info Events.
        :type include_kubernetes_info_events: bool
        :param event_type_filters: A string representing an event type - an INCIDENT, ISSUE, or CHANGE. This query can be repeated to use multiple filters.
        :type event_type_filters: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            include_agent_monitoring_issues=include_agent_monitoring_issues,
            include_kubernetes_info_events=include_kubernetes_info_events,
            event_type_filters=event_type_filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '400': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_events_with_http_info(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        include_agent_monitoring_issues: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to include Agent Monitoring Issues.")] = None,
        include_kubernetes_info_events: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to include Kubernetes Info Events.")] = None,
        event_type_filters: Annotated[Optional[List[StrictStr]], Field(description="A string representing an event type - an INCIDENT, ISSUE, or CHANGE. This query can be repeated to use multiple filters.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[EventResult]]:
        """Get all Events

        Get all Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param include_agent_monitoring_issues: Flag to filter the results to include Agent Monitoring Issues.
        :type include_agent_monitoring_issues: bool
        :param include_kubernetes_info_events: Flag to filter the results to include Kubernetes Info Events.
        :type include_kubernetes_info_events: bool
        :param event_type_filters: A string representing an event type - an INCIDENT, ISSUE, or CHANGE. This query can be repeated to use multiple filters.
        :type event_type_filters: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            include_agent_monitoring_issues=include_agent_monitoring_issues,
            include_kubernetes_info_events=include_kubernetes_info_events,
            event_type_filters=event_type_filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '400': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def get_events_without_preload_content(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        include_agent_monitoring_issues: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to include Agent Monitoring Issues.")] = None,
        include_kubernetes_info_events: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to include Kubernetes Info Events.")] = None,
        event_type_filters: Annotated[Optional[List[StrictStr]], Field(description="A string representing an event type - an INCIDENT, ISSUE, or CHANGE. This query can be repeated to use multiple filters.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get all Events

        Get all Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param include_agent_monitoring_issues: Flag to filter the results to include Agent Monitoring Issues.
        :type include_agent_monitoring_issues: bool
        :param include_kubernetes_info_events: Flag to filter the results to include Kubernetes Info Events.
        :type include_kubernetes_info_events: bool
        :param event_type_filters: A string representing an event type - an INCIDENT, ISSUE, or CHANGE. This query can be repeated to use multiple filters.
        :type event_type_filters: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            include_agent_monitoring_issues=include_agent_monitoring_issues,
            include_kubernetes_info_events=include_kubernetes_info_events,
            event_type_filters=event_type_filters,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '400': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_events_serialize(
        self,
        to,
        window_size,
        var_from,
        filter_event_updates,
        exclude_triggered_before,
        include_agent_monitoring_issues,
        include_kubernetes_info_events,
        event_type_filters,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'eventTypeFilters': 'multi',
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if to is not None:
            
            _query_params.append(('to', to))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if var_from is not None:
            
            _query_params.append(('from', var_from))
            
        if filter_event_updates is not None:
            
            _query_params.append(('filterEventUpdates', filter_event_updates))
            
        if exclude_triggered_before is not None:
            
            _query_params.append(('excludeTriggeredBefore', exclude_triggered_before))
            
        if include_agent_monitoring_issues is not None:
            
            _query_params.append(('includeAgentMonitoringIssues', include_agent_monitoring_issues))
            
        if include_kubernetes_info_events is not None:
            
            _query_params.append(('includeKubernetesInfoEvents', include_kubernetes_info_events))
            
        if event_type_filters is not None:
            
            _query_params.append(('eventTypeFilters', event_type_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] = [
            'ApiKeyAuth'
        ]

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




    @validate_call
    def get_events_by_ids(
        self,
        request_body: List[StrictStr],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[EventResult]:
        """Get Events by IDs

        Gets a set of events by their IDs. 

        :param request_body: (required)
        :type request_body: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_events_by_ids_serialize(
            request_body=request_body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def get_events_by_ids_with_http_info(
        self,
        request_body: List[StrictStr],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[EventResult]]:
        """Get Events by IDs

        Gets a set of events by their IDs. 

        :param request_body: (required)
        :type request_body: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_events_by_ids_serialize(
            request_body=request_body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    @validate_call
    def get_events_by_ids_without_preload_content(
        self,
        request_body: List[StrictStr],
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Events by IDs

        Gets a set of events by their IDs. 

        :param request_body: (required)
        :type request_body: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_events_by_ids_serialize(
            request_body=request_body,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '206': None,
            '422': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_events_by_ids_serialize(
        self,
        request_body,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

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

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if request_body is not None:
            _body_params = request_body


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

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

        # authentication setting
        _auth_settings: List[str] = [
            'ApiKeyAuth'
        ]

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




    @validate_call
    def kubernetes_info_events(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> List[EventResult]:
        """Get Kubernetes Info Events

        Gets all Kubernetes Info Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._kubernetes_info_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '404': None,
        }
        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 kubernetes_info_events_with_http_info(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[List[EventResult]]:
        """Get Kubernetes Info Events

        Gets all Kubernetes Info Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._kubernetes_info_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )


    @validate_call
    def kubernetes_info_events_without_preload_content(
        self,
        to: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]")] = None,
        var_from: Annotated[Optional[StrictInt], Field(description="A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]")] = None,
        filter_event_updates: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to only show events with state changes within the timeframe.")] = None,
        exclude_triggered_before: Annotated[Optional[StrictBool], Field(description="Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Get Kubernetes Info Events

        Gets all Kubernetes Info Events within a timeframe. The timeframe is defined as `[from, to]` or `[to - windowSize, to]`. 

        :param to: A Unix timestamp representing the end of the requested timeframe. Defaults to the current system time
        :type to: int
        :param window_size: The size of the requested timeframe, in milliseconds, relative to the 'to' parameter. Defaults to 10 minutes (600000 milliseconds) if neither 'windowSize' nor 'from' are provided. Resulting timeframe range = [to - windowSize, to]
        :type window_size: int
        :param var_from: A Unix timestamp representing the start of the requested timeframe. Can be used as an alternative to 'windowSize' to define the timeframe. If both 'from' and 'windowSize' are provided, 'from' takes precedence. Resulting timeframe range = [from, to]
        :type var_from: int
        :param filter_event_updates: Flag to filter the results to only show events with state changes within the timeframe.
        :type filter_event_updates: bool
        :param exclude_triggered_before: Flag to filter the results to exclude events that have been triggered before the timeframe. This also filters out events with state changes within the timeframe if the events' start times begin before the timeframe.
        :type exclude_triggered_before: bool
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._kubernetes_info_events_serialize(
            to=to,
            window_size=window_size,
            var_from=var_from,
            filter_event_updates=filter_event_updates,
            exclude_triggered_before=exclude_triggered_before,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[EventResult]",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _kubernetes_info_events_serialize(
        self,
        to,
        window_size,
        var_from,
        filter_event_updates,
        exclude_triggered_before,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if to is not None:
            
            _query_params.append(('to', to))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if var_from is not None:
            
            _query_params.append(('from', var_from))
            
        if filter_event_updates is not None:
            
            _query_params.append(('filterEventUpdates', filter_event_updates))
            
        if exclude_triggered_before is not None:
            
            _query_params.append(('excludeTriggeredBefore', exclude_triggered_before))
            
        # 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] = [
            'ApiKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/api/events/kubernetes-info-events',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


