# coding: utf-8

"""
    Internet Insights API

    **Note:** All Internet Insights APIs are not available for ThousandEyes for Government instance.  We are happy to announce the release of the Internet Insights API set. This limited release includes endpoints that:  * Make our catalog provider and Internet outage data accessible to API users. * Provide access to advanced filtering, which is part of our next-generation API efforts to allow API users to fine-tune queries across all of our APIs in a consistent manner.  Internet Insights provide visibility into core Internet infrastructure, including ISPs, DNS providers, IaaS, CDNs , and SaaS providers. It tracks the macro-level impact of Internet events on individual users and enterprise networks connecting at the edge of the Internet. These events include Outages, Routing hijacks and leaks, DDoS attacks, And political interference, among others.  Future releases of the Internet Insights API set will further unlock access to core Internet Insights functionality, unlocking potential integrations to enrich customer process flows.  For more information about Internet Insights, see the [Internet Insights](https://docs.thousandeyes.com/product-documentation/internet-insights). 

    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 importlib.metadata import version

import thousandeyes_sdk.internet_insights.models

from pydantic import Field, StrictStr
from typing import Optional
from typing_extensions import Annotated
from thousandeyes_sdk.internet_insights.models.api_application_outage_details import ApiApplicationOutageDetails
from thousandeyes_sdk.internet_insights.models.api_network_outage_details import ApiNetworkOutageDetails
from thousandeyes_sdk.internet_insights.models.api_outage_filter import ApiOutageFilter
from thousandeyes_sdk.internet_insights.models.api_outages_response import ApiOutagesResponse

from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized
from thousandeyes_sdk.core.api_response import ApiResponse

from thousandeyes_sdk.core.rest import RESTResponseType


class InternetInsightsOutagesApi:
    """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()
        api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-internet-insights"))
        self.api_client = api_client


    @validate_call
    def filter_outages(
        self,
        api_outage_filter: ApiOutageFilter,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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,
    ) -> ApiOutagesResponse:
        """List network and application outages

        Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported.  <b>Note:</b> Support for pagination will be added in the future.   ## Samples Queries with Different Filter Permutations   ### Window  ```  curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{   \"window\" : \"1d\"   }' ```  ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\"   }' ```  ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\",     \"outageScope\": \"with-affected-test\"   }' ``` ### Date Range with Network ```   curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter'   --header 'Authorization: Bearer $token'   --header 'Content-Type: application/json'   --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"interfaceNetwork\":  [\"Telianet\"]     }' ```  ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter'   --header 'Authorization: Bearer $token'   --header 'Content-Type: application/json'   --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"applicationName\": [\"Google\"]   }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"providerName\": [\"Century Link\", \"Microsoft\"]   }'  ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\",     \"outageScope\": \"all\",     \"applicationName\": [\"Google\"] }' ``` 

        :param api_outage_filter: (required)
        :type api_outage_filter: ApiOutageFilter
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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._filter_outages_serialize(
            api_outage_filter=api_outage_filter,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiOutagesResponse",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        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,
            models=thousandeyes_sdk.internet_insights.models,
        ).data


    @validate_call
    def filter_outages_with_http_info(
        self,
        api_outage_filter: ApiOutageFilter,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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[ApiOutagesResponse]:
        """List network and application outages

        Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported.  <b>Note:</b> Support for pagination will be added in the future.   ## Samples Queries with Different Filter Permutations   ### Window  ```  curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{   \"window\" : \"1d\"   }' ```  ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\"   }' ```  ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\",     \"outageScope\": \"with-affected-test\"   }' ``` ### Date Range with Network ```   curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter'   --header 'Authorization: Bearer $token'   --header 'Content-Type: application/json'   --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"interfaceNetwork\":  [\"Telianet\"]     }' ```  ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter'   --header 'Authorization: Bearer $token'   --header 'Content-Type: application/json'   --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"applicationName\": [\"Google\"]   }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"providerName\": [\"Century Link\", \"Microsoft\"]   }'  ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\",     \"outageScope\": \"all\",     \"applicationName\": [\"Google\"] }' ``` 

        :param api_outage_filter: (required)
        :type api_outage_filter: ApiOutageFilter
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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._filter_outages_serialize(
            api_outage_filter=api_outage_filter,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiOutagesResponse",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        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,
            models=thousandeyes_sdk.internet_insights.models,
        )


    @validate_call
    def filter_outages_without_preload_content(
        self,
        api_outage_filter: ApiOutageFilter,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """List network and application outages

        Returns a list of network and application outages using a filter object. Advanced Filter persistance is not currently supported.  <b>Note:</b> Support for pagination will be added in the future.   ## Samples Queries with Different Filter Permutations   ### Window  ```  curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token --header 'Accept-Encoding: application/gzip' --header 'Content-Type: application/json' --data-raw '{   \"window\" : \"1d\"   }' ```  ### Date Range ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\"   }' ```  ### Date Range with Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\",     \"outageScope\": \"with-affected-test\"   }' ``` ### Date Range with Network ```   curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter'   --header 'Authorization: Bearer $token'   --header 'Content-Type: application/json'   --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"interfaceNetwork\":  [\"Telianet\"]     }' ```  ### Date Range with Application ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter'   --header 'Authorization: Bearer $token'   --header 'Content-Type: application/json'   --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"applicationName\": [\"Google\"]   }' ``` ### Date Range with Provider ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{       \"startDate\": \"2022-03-01T01:30:00Z\",       \"endDate\"  : \"2022-03-01T23:30:15Z\",       \"providerName\": [\"Century Link\", \"Microsoft\"]   }'  ``` ### Date Range with Application and Scope ``` curl --location --request POST 'https://api.thousandeyes.com/v7/internet-insights/outages/filter' --header 'Authorization: Bearer $token' --header 'Content-Type: application/json' --data-raw '{     \"startDate\": \"2022-03-01T01:30:00Z\",     \"endDate\"  : \"2022-03-01T23:30:15Z\",     \"outageScope\": \"all\",     \"applicationName\": [\"Google\"] }' ``` 

        :param api_outage_filter: (required)
        :type api_outage_filter: ApiOutageFilter
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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._filter_outages_serialize(
            api_outage_filter=api_outage_filter,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiOutagesResponse",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _filter_outages_serialize(
        self,
        api_outage_filter,
        aid,
        _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]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if aid is not None:
            
            _query_params.append(('aid', aid))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if api_outage_filter is not None:
            _body_params = api_outage_filter


        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            [
                'application/hal+json', 
                'application/json', 
                'application/problem+json'
            ]
        )

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

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

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/internet-insights/outages/filter',
            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_app_outage(
        self,
        outage_id: StrictStr,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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,
    ) -> ApiApplicationOutageDetails:
        """Retrieve application outage

        Returns the details of an application outage. 

        :param outage_id: (required)
        :type outage_id: str
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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_app_outage_serialize(
            outage_id=outage_id,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiApplicationOutageDetails",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        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,
            models=thousandeyes_sdk.internet_insights.models,
        ).data


    @validate_call
    def get_app_outage_with_http_info(
        self,
        outage_id: StrictStr,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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[ApiApplicationOutageDetails]:
        """Retrieve application outage

        Returns the details of an application outage. 

        :param outage_id: (required)
        :type outage_id: str
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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_app_outage_serialize(
            outage_id=outage_id,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiApplicationOutageDetails",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        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,
            models=thousandeyes_sdk.internet_insights.models,
        )


    @validate_call
    def get_app_outage_without_preload_content(
        self,
        outage_id: StrictStr,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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:
        """Retrieve application outage

        Returns the details of an application outage. 

        :param outage_id: (required)
        :type outage_id: str
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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_app_outage_serialize(
            outage_id=outage_id,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiApplicationOutageDetails",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_app_outage_serialize(
        self,
        outage_id,
        aid,
        _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]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if outage_id is not None:
            _path_params['outageId'] = outage_id
        # process the query parameters
        if aid is not None:
            
            _query_params.append(('aid', aid))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            [
                'application/hal+json', 
                'application/json', 
                'application/problem+json'
            ]
        )


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/internet-insights/outages/app/{outageId}',
            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_network_outage(
        self,
        outage_id: StrictStr,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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,
    ) -> ApiNetworkOutageDetails:
        """Retrieve network outage

        Returns the details of a network outage. 

        :param outage_id: (required)
        :type outage_id: str
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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_network_outage_serialize(
            outage_id=outage_id,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiNetworkOutageDetails",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        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,
            models=thousandeyes_sdk.internet_insights.models,
        ).data


    @validate_call
    def get_network_outage_with_http_info(
        self,
        outage_id: StrictStr,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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[ApiNetworkOutageDetails]:
        """Retrieve network outage

        Returns the details of a network outage. 

        :param outage_id: (required)
        :type outage_id: str
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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_network_outage_serialize(
            outage_id=outage_id,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiNetworkOutageDetails",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        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,
            models=thousandeyes_sdk.internet_insights.models,
        )


    @validate_call
    def get_network_outage_without_preload_content(
        self,
        outage_id: StrictStr,
        aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = 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:
        """Retrieve network outage

        Returns the details of a network outage. 

        :param outage_id: (required)
        :type outage_id: str
        :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
        :type aid: 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_network_outage_serialize(
            outage_id=outage_id,
            aid=aid,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "ApiNetworkOutageDetails",
            '400': "ValidationError",
            '401': "UnauthorizedError",
            '403': "Error",
            '404': "Error",
            '429': "Error",
            '500': "Error",
            '502': "Error",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_network_outage_serialize(
        self,
        outage_id,
        aid,
        _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]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if outage_id is not None:
            _path_params['outageId'] = outage_id
        # process the query parameters
        if aid is not None:
            
            _query_params.append(('aid', aid))
            
        # process the header parameters
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        _header_params['Accept'] = self.api_client.select_header_accept(
            [
                'application/hal+json', 
                'application/json', 
                'application/problem+json'
            ]
        )


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

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/internet-insights/outages/net/{outageId}',
            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
        )


