# 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.application_result import ApplicationResult
from instana_client.models.endpoint import Endpoint
from instana_client.models.endpoint_result import EndpointResult
from instana_client.models.service import Service
from instana_client.models.service_result import ServiceResult

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


class ApplicationResourcesApi:
    """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 get_application_endpoints(
        self,
        app_id: Annotated[Optional[StrictStr], Field(description="Application ID")] = None,
        service_id: Annotated[Optional[StrictStr], Field(description="Service ID")] = None,
        endpoint_id: Annotated[Optional[StrictStr], Field(description="Endpoint ID")] = None,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service")] = None,
        types: Annotated[Optional[List[StrictStr]], Field(description="Type of Endpoint")] = None,
        technologies: Annotated[Optional[List[StrictStr]], Field(description="List of technologies")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = 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,
    ) -> Union[EndpointResult, Endpoint]:
        """Get endpoints

        Use this API endpoint if one wants to retrieve a list of Endpoints. A use case could be to view the endpoint id of an Endpoint.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param app_id: Application ID (optional, used to filter endpoints by application)
        :type app_id: str
        :param service_id: Service ID (optional, used to filter endpoints by service)
        :type service_id: str
        :param endpoint_id: Endpoint ID (optional, used to get a specific endpoint)
        :type endpoint_id: str
        :param name_filter: Name of service
        :type name_filter: str
        :param types: Type of Endpoint
        :type types: List[str]
        :param technologies: List of technologies
        :type technologies: List[str]
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: 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_application_endpoints_serialize(
            app_id=app_id,
            service_id=service_id,
            endpoint_id=endpoint_id,
            name_filter=name_filter,
            types=types,
            technologies=technologies,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        # Determine response type based on parameters
        if app_id and service_id and endpoint_id:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "Endpoint",
            }
        else:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "EndpointResult",
            }
        
        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_application_endpoints_with_http_info(
        self,
        app_id: Annotated[Optional[StrictStr], Field(description="Application ID")] = None,
        service_id: Annotated[Optional[StrictStr], Field(description="Service ID")] = None,
        endpoint_id: Annotated[Optional[StrictStr], Field(description="Endpoint ID")] = None,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service")] = None,
        types: Annotated[Optional[List[StrictStr]], Field(description="Type of Endpoint")] = None,
        technologies: Annotated[Optional[List[StrictStr]], Field(description="List of technologies")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = 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,
    ) -> Union[ApiResponse[EndpointResult], ApiResponse[Endpoint]]:
        """Get endpoints

        Use this API endpoint if one wants to retrieve a list of Endpoints. A use case could be to view the endpoint id of an Endpoint.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param app_id: Application ID (optional, used to filter endpoints by application)
        :type app_id: str
        :param service_id: Service ID (optional, used to filter endpoints by service)
        :type service_id: str
        :param endpoint_id: Endpoint ID (optional, used to get a specific endpoint)
        :type endpoint_id: str
        :param name_filter: Name of service
        :type name_filter: str
        :param types: Type of Endpoint
        :type types: List[str]
        :param technologies: List of technologies
        :type technologies: List[str]
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: 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_application_endpoints_serialize(
            app_id=app_id,
            service_id=service_id,
            endpoint_id=endpoint_id,
            name_filter=name_filter,
            types=types,
            technologies=technologies,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        # Determine response type based on parameters
        if app_id and service_id and endpoint_id:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "Endpoint",
            }
        else:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "EndpointResult",
            }
        
        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_application_endpoints_without_preload_content(
        self,
        app_id: Annotated[Optional[StrictStr], Field(description="Application ID")] = None,
        service_id: Annotated[Optional[StrictStr], Field(description="Service ID")] = None,
        endpoint_id: Annotated[Optional[StrictStr], Field(description="Endpoint ID")] = None,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service")] = None,
        types: Annotated[Optional[List[StrictStr]], Field(description="Type of Endpoint")] = None,
        technologies: Annotated[Optional[List[StrictStr]], Field(description="List of technologies")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = 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 endpoints

        Use this API endpoint if one wants to retrieve a list of Endpoints. A use case could be to view the endpoint id of an Endpoint.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param app_id: Application ID (optional, used to filter endpoints by application)
        :type app_id: str
        :param service_id: Service ID (optional, used to filter endpoints by service)
        :type service_id: str
        :param endpoint_id: Endpoint ID (optional, used to get a specific endpoint)
        :type endpoint_id: str
        :param name_filter: Name of service
        :type name_filter: str
        :param types: Type of Endpoint
        :type types: List[str]
        :param technologies: List of technologies
        :type technologies: List[str]
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: 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_application_endpoints_serialize(
            app_id=app_id,
            service_id=service_id,
            endpoint_id=endpoint_id,
            name_filter=name_filter,
            types=types,
            technologies=technologies,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        # Determine response type based on parameters
        if app_id and service_id and endpoint_id:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "Endpoint",
            }
        else:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "EndpointResult",
            }
        
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_application_endpoints_serialize(
        self,
        app_id,
        service_id,
        endpoint_id,
        name_filter,
        types,
        technologies,
        window_size,
        to,
        page,
        page_size,
        application_boundary_scope,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
            'types': 'multi',
            'technologies': '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 name_filter is not None:
            
            _query_params.append(('nameFilter', name_filter))
            
        if types is not None:
            
            _query_params.append(('types', types))
            
        if technologies is not None:
            
            _query_params.append(('technologies', technologies))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if to is not None:
            
            _query_params.append(('to', to))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if application_boundary_scope is not None:
            
            _query_params.append(('applicationBoundaryScope', application_boundary_scope))
            
        # 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'
                ]
            )


        # Build dynamic resource path based on app_id, service_id, and endpoint_id
        if app_id and service_id and endpoint_id:
            resource_path = f'/api/application-monitoring/applications;id={app_id}/services;id={service_id}/endpoints;id={endpoint_id}'
        elif app_id and service_id:
            resource_path = f'/api/application-monitoring/applications;id={app_id}/services;id={service_id}/endpoints'
        elif app_id:
            resource_path = f'/api/application-monitoring/applications;id={app_id}/services/endpoints'
        else:
            resource_path = '/api/application-monitoring/applications/services/endpoints'

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

        return self.api_client.param_serialize(
            method='GET',
            resource_path=resource_path,
            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_application_services(
        self,
        app_id: Annotated[Optional[StrictStr], Field(description="Application ID")] = None,
        service_id: Annotated[Optional[StrictStr], Field(description="Service ID")] = None,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service (partial match allowed)")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = None,
        include_snapshot_ids: Annotated[Optional[StrictBool], Field(description="Include snapshot ids in the results")] = 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,
    ) -> Union[ServiceResult, Service]:
        """Get applications/services

        Use this API endpoint if one wants to retrieve a list of services in an Application Perspective. A use case could be to retrieve all service ids present in an Application Perspective.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param app_id: Application ID (optional, used to filter services by application)
        :type app_id: str
        :param service_id: Service ID (optional, used to filter specific service)
        :type service_id: str
        :param name_filter: Name of service (partial match allowed)
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: str
        :param include_snapshot_ids: Include snapshot ids in the results
        :type include_snapshot_ids: 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._get_application_services_serialize(
            app_id=app_id,
            service_id=service_id,
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            include_snapshot_ids=include_snapshot_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        # Determine response type based on parameters
        if app_id and service_id:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "Service",
            }
        else:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "ServiceResult",
            }
        
        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_application_services_with_http_info(
        self,
        app_id: Annotated[Optional[StrictStr], Field(description="Application ID")] = None,
        service_id: Annotated[Optional[StrictStr], Field(description="Service ID")] = None,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service (partial match allowed)")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = None,
        include_snapshot_ids: Annotated[Optional[StrictBool], Field(description="Include snapshot ids in the results")] = 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,
    ) -> Union[ApiResponse[ServiceResult], ApiResponse[Service]]:
        """Get applications/services

        Use this API endpoint if one wants to retrieve a list of services in an Application Perspective. A use case could be to retrieve all service ids present in an Application Perspective.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param app_id: Application ID (optional, used to filter services by application)
        :type app_id: str
        :param service_id: Service ID (optional, used to filter specific service)
        :type service_id: str
        :param name_filter: Name of service (partial match allowed)
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: str
        :param include_snapshot_ids: Include snapshot ids in the results
        :type include_snapshot_ids: 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._get_application_services_serialize(
            app_id=app_id,
            service_id=service_id,
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            include_snapshot_ids=include_snapshot_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        # Determine response type based on parameters
        if app_id and service_id:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "Service",
            }
        else:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "ServiceResult",
            }
        
        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_application_services_without_preload_content(
        self,
        app_id: Annotated[Optional[StrictStr], Field(description="Application ID")] = None,
        service_id: Annotated[Optional[StrictStr], Field(description="Service ID")] = None,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service (partial match allowed)")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = None,
        include_snapshot_ids: Annotated[Optional[StrictBool], Field(description="Include snapshot ids in the results")] = 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 applications/services

        Use this API endpoint if one wants to retrieve a list of services in an Application Perspective. A use case could be to retrieve all service ids present in an Application Perspective.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param app_id: Application ID (optional, used to filter services by application)
        :type app_id: str
        :param service_id: Service ID (optional, used to filter specific service)
        :type service_id: str
        :param name_filter: Name of service (partial match allowed)
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: str
        :param include_snapshot_ids: Include snapshot ids in the results
        :type include_snapshot_ids: 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._get_application_services_serialize(
            app_id=app_id,
            service_id=service_id,
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            include_snapshot_ids=include_snapshot_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        # Determine response type based on parameters
        if app_id and service_id:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "Service",
            }
        else:
            _response_types_map: Dict[str, Optional[str]] = {
                '200': "ServiceResult",
            }
        
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_application_services_serialize(
        self,
        app_id,
        service_id,
        name_filter,
        window_size,
        to,
        page,
        page_size,
        application_boundary_scope,
        include_snapshot_ids,
        _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 name_filter is not None:
            
            _query_params.append(('nameFilter', name_filter))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if to is not None:
            
            _query_params.append(('to', to))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if application_boundary_scope is not None:
            
            _query_params.append(('applicationBoundaryScope', application_boundary_scope))
            
        if include_snapshot_ids is not None:
            
            _query_params.append(('includeSnapshotIds', include_snapshot_ids))
            
        # 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'
                ]
            )


        # Build dynamic resource path based on app_id and service_id
        if app_id and service_id:
            resource_path = f'/api/application-monitoring/applications;id={app_id}/services;id={service_id}'
        elif app_id:
            resource_path = f'/api/application-monitoring/applications;id={app_id}/services'
        else:
            resource_path = '/api/application-monitoring/applications/services'

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

        return self.api_client.param_serialize(
            method='GET',
            resource_path=resource_path,
            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_applications(
        self,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of application")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = 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,
    ) -> ApplicationResult:
        """Get applications

        Use this API endpoint if one wants to retrieve a list of Application Perspectives. A use case could be to view the application id of an Application Perspective.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param name_filter: Name of application
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: 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_applications_serialize(
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApplicationResult",
        }
        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_applications_with_http_info(
        self,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of application")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = 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[ApplicationResult]:
        """Get applications

        Use this API endpoint if one wants to retrieve a list of Application Perspectives. A use case could be to view the application id of an Application Perspective.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param name_filter: Name of application
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: 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_applications_serialize(
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApplicationResult",
        }
        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_applications_without_preload_content(
        self,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of application")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        application_boundary_scope: Annotated[Optional[StrictStr], Field(description="Filter for application scope, i.e: INBOUND or ALL")] = 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 applications

        Use this API endpoint if one wants to retrieve a list of Application Perspectives. A use case could be to view the application id of an Application Perspective.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param name_filter: Name of application
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param application_boundary_scope: Filter for application scope, i.e: INBOUND or ALL
        :type application_boundary_scope: 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_applications_serialize(
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            application_boundary_scope=application_boundary_scope,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _get_applications_serialize(
        self,
        name_filter,
        window_size,
        to,
        page,
        page_size,
        application_boundary_scope,
        _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 name_filter is not None:
            
            _query_params.append(('nameFilter', name_filter))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if to is not None:
            
            _query_params.append(('to', to))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if application_boundary_scope is not None:
            
            _query_params.append(('applicationBoundaryScope', application_boundary_scope))
            
        # 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/application-monitoring/applications',
            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_services(
        self,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        include_snapshot_ids: Annotated[Optional[StrictBool], Field(description="Include snapshot ids in the results")] = 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,
    ) -> ServiceResult:
        """Get services

        Use this API endpoint if one wants to retrieve a list of Services. A use case could be to view the service id of a Service.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param name_filter: Name of service
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param include_snapshot_ids: Include snapshot ids in the results
        :type include_snapshot_ids: 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._get_services_serialize(
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            include_snapshot_ids=include_snapshot_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ServiceResult",
        }
        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_services_with_http_info(
        self,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        include_snapshot_ids: Annotated[Optional[StrictBool], Field(description="Include snapshot ids in the results")] = 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[ServiceResult]:
        """Get services

        Use this API endpoint if one wants to retrieve a list of Services. A use case could be to view the service id of a Service.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param name_filter: Name of service
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param include_snapshot_ids: Include snapshot ids in the results
        :type include_snapshot_ids: 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._get_services_serialize(
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            include_snapshot_ids=include_snapshot_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ServiceResult",
        }
        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_services_without_preload_content(
        self,
        name_filter: Annotated[Optional[StrictStr], Field(description="Name of service")] = None,
        window_size: Annotated[Optional[StrictInt], Field(description="Size of time window in milliseconds")] = None,
        to: Annotated[Optional[StrictInt], Field(description="Timestamp since Unix Epoch in milliseconds of the end of the time window")] = None,
        page: Annotated[Optional[StrictInt], Field(description="Page number from results")] = None,
        page_size: Annotated[Optional[StrictInt], Field(description="Number of items per page")] = None,
        include_snapshot_ids: Annotated[Optional[StrictBool], Field(description="Include snapshot ids in the results")] = 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 services

        Use this API endpoint if one wants to retrieve a list of Services. A use case could be to view the service id of a Service.  For more information on Application Resources please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Applications#application-resources.

        :param name_filter: Name of service
        :type name_filter: str
        :param window_size: Size of time window in milliseconds
        :type window_size: int
        :param to: Timestamp since Unix Epoch in milliseconds of the end of the time window
        :type to: int
        :param page: Page number from results
        :type page: int
        :param page_size: Number of items per page
        :type page_size: int
        :param include_snapshot_ids: Include snapshot ids in the results
        :type include_snapshot_ids: 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._get_services_serialize(
            name_filter=name_filter,
            window_size=window_size,
            to=to,
            page=page,
            page_size=page_size,
            include_snapshot_ids=include_snapshot_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

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


    def _get_services_serialize(
        self,
        name_filter,
        window_size,
        to,
        page,
        page_size,
        include_snapshot_ids,
        _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 name_filter is not None:
            
            _query_params.append(('nameFilter', name_filter))
            
        if window_size is not None:
            
            _query_params.append(('windowSize', window_size))
            
        if to is not None:
            
            _query_params.append(('to', to))
            
        if page is not None:
            
            _query_params.append(('page', page))
            
        if page_size is not None:
            
            _query_params.append(('pageSize', page_size))
            
        if include_snapshot_ids is not None:
            
            _query_params.append(('includeSnapshotIds', include_snapshot_ids))
            
        # 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/application-monitoring/services',
            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
        )


