# coding: utf-8

"""
    Endpoint Test Results API

    Retrieve results for scheduled and dynamic tests on endpoint agents.

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

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


import json
import unittest
import thousandeyes_sdk.endpoint_test_results.models

from thousandeyes_sdk.core.exceptions import ApiException
from thousandeyes_sdk.endpoint_test_results.api.real_user_endpoint_test_results_api import RealUserEndpointTestResultsApi
from .integration_test_utils import IntegrationTestBase
from .test_utils import assert_constructed_model_matches_example_json


class TestRealUserEndpointTestResultsApiIntegration(IntegrationTestBase):
    """RealUserEndpointTestResultsApi integration test stubs"""

    def setUp(self) -> None:
        super().setUp()
        self.api = RealUserEndpointTestResultsApi(self.api_client)


    def test_filter_real_user_tests_network_results_happy_path(self) -> None:
        """Integration test for filter_real_user_tests_network_results success path"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        response_body_json = """
                {
                  "endDate" : "2022-07-18T22:00:54Z",
                  "_links" : {
                    "next" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "results" : [ {
                    "date" : "2022-07-17T22:00:54Z",
                    "proxy" : {
                      "loss" : 0.1,
                      "jitter" : 46,
                      "latency" : 150,
                      "target" : "54.208.6.220"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "systemMetrics" : {
                      "cpuUtilization" : {
                        "min" : 0.22,
                        "median" : 0.61,
                        "max" : 0.75,
                        "mean" : 0.55,
                        "count" : 150,
                        "stdDev" : 0.01
                      },
                      "physicalMemoryTotalBytes" : 1024,
                      "startTimeMs" : 1581508857327,
                      "physicalMemoryUsedBytes" : {
                        "min" : 1.2,
                        "median" : 1.85,
                        "max" : 2.5,
                        "mean" : 1.77,
                        "count" : 155,
                        "stdDev" : 0.25
                      },
                      "endTimeMs" : 1581508867333
                    },
                    "vpn" : {
                      "loss" : 0.1,
                      "jitter" : 46,
                      "latency" : 150,
                      "target" : "54.208.6.220"
                    },
                    "destination" : {
                      "loss" : 0.1,
                      "jitter" : 46,
                      "latency" : 150,
                      "target" : "54.208.6.220"
                    },
                    "id" : "07625:1490529480:aVDViw0i",
                    "roundId" : 1384309800
                  }, {
                    "date" : "2022-07-17T22:00:54Z",
                    "proxy" : {
                      "loss" : 0.1,
                      "jitter" : 46,
                      "latency" : 150,
                      "target" : "54.208.6.220"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "systemMetrics" : {
                      "cpuUtilization" : {
                        "min" : 0.22,
                        "median" : 0.61,
                        "max" : 0.75,
                        "mean" : 0.55,
                        "count" : 150,
                        "stdDev" : 0.01
                      },
                      "physicalMemoryTotalBytes" : 1024,
                      "startTimeMs" : 1581508857327,
                      "physicalMemoryUsedBytes" : {
                        "min" : 1.2,
                        "median" : 1.85,
                        "max" : 2.5,
                        "mean" : 1.77,
                        "count" : 155,
                        "stdDev" : 0.25
                      },
                      "endTimeMs" : 1581508867333
                    },
                    "vpn" : {
                      "loss" : 0.1,
                      "jitter" : 46,
                      "latency" : 150,
                      "target" : "54.208.6.220"
                    },
                    "destination" : {
                      "loss" : 0.1,
                      "jitter" : 46,
                      "latency" : 150,
                      "target" : "54.208.6.220"
                    },
                    "id" : "07625:1490529480:aVDViw0i",
                    "roundId" : 1384309800
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.filter_real_user_tests_network_results(

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

            _headers=self.te_headers("filter_real_user_tests_network_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_filter_real_user_tests_network_results_error_400(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "errors" : [ {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  }, {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  } ],
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(400)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="400"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_network_results_error_401(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_network_results_error_403(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_network_results_error_404(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_network_results_error_429(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_network_results_error_500(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_network_results_error_502(self) -> None:
        """Integration test for filter_real_user_tests_network_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.filter_real_user_tests_network_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_network_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_filter_real_user_tests_results_happy_path(self) -> None:
        """Integration test for filter_real_user_tests_results success path"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        response_body_json = """
                {
                  "endDate" : "2022-07-18T22:00:54Z",
                  "_links" : {
                    "next" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "results" : [ {
                    "date" : "2022-07-17T22:00:54Z",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "committed" : "2022-07-17T22:00:54Z",
                    "experienceScore" : 0.5,
                    "sourceAddress" : "84.255.241.1",
                    "organizationName" : "T-2 Access Network",
                    "visitedSite" : "www.thousandeyes.com",
                    "pageId" : "C31gBrYJ",
                    "protocol" : "https",
                    "numberOfPages" : 2,
                    "port" : 443,
                    "id" : "07625:1490529480:aVDViw0i",
                    "roundId" : 1384309800
                  }, {
                    "date" : "2022-07-17T22:00:54Z",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "committed" : "2022-07-17T22:00:54Z",
                    "experienceScore" : 0.5,
                    "sourceAddress" : "84.255.241.1",
                    "organizationName" : "T-2 Access Network",
                    "visitedSite" : "www.thousandeyes.com",
                    "pageId" : "C31gBrYJ",
                    "protocol" : "https",
                    "numberOfPages" : 2,
                    "port" : 443,
                    "id" : "07625:1490529480:aVDViw0i",
                    "roundId" : 1384309800
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.filter_real_user_tests_results(

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

            _headers=self.te_headers("filter_real_user_tests_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_filter_real_user_tests_results_error_400(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "errors" : [ {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  }, {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  } ],
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(400)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="400"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_results_error_401(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_results_error_403(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_results_error_404(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_results_error_429(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_results_error_500(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_results_error_502(self) -> None:
        """Integration test for filter_real_user_tests_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "searchFilters" : {
                    "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                    "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                    "visitedSite" : [ "app.thousandeyes.com" ],
                    "trigger" : [ "user" ],
                    "ssid" : [ "wifi-name", "other-room-wifi" ],
                    "platform" : [ "mac", "mac" ],
                    "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                    "domain" : [ "thousandeyes.com" ],
                    "location" : [ "San Francisco Bay Area", "Germany" ],
                    "connection" : [ "wireless", "wireless" ],
                    "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                    "networkId" : [ "660b34109d12", "660b34109d15" ],
                    "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                  }
                }
        
                """
        real_user_endpoint_test_results_request = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultsRequest.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.filter_real_user_tests_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_results_request=real_user_endpoint_test_results_request,

                _headers=self.te_headers("filter_real_user_tests_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_filter_real_user_tests_visited_pages_results_happy_path(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results success path"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        response_body_json = """
                {
                  "endDate" : "2022-07-18T22:00:54Z",
                  "_links" : {
                    "next" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "results" : [ {
                    "pageTimings" : {
                      "onContentLoad" : 1483,
                      "onLoad" : 4569
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "systemMetrics" : {
                      "cpuUtilization" : {
                        "min" : 0.22,
                        "median" : 0.61,
                        "max" : 0.75,
                        "mean" : 0.55,
                        "count" : 150,
                        "stdDev" : 0.01
                      },
                      "physicalMemoryTotalBytes" : 1024,
                      "startTimeMs" : 1581508857327,
                      "physicalMemoryUsedBytes" : {
                        "min" : 1.2,
                        "median" : 1.85,
                        "max" : 2.5,
                        "mean" : 1.77,
                        "count" : 155,
                        "stdDev" : 0.25
                      },
                      "endTimeMs" : 1581508867333
                    },
                    "pageTitle" : "Network Performance Resources | ThousandEyes",
                    "responseTime" : 240,
                    "pageUrl" : "https://app.thousandeyes.com/settings/integrations",
                    "id" : "07625:1490529480:aVDViw0i",
                    "pageId" : "C31gBrYJ",
                    "roundId" : 1384309800,
                    "loadDate" : "2022-07-17T22:00:54Z",
                    "responseCode" : 200
                  }, {
                    "pageTimings" : {
                      "onContentLoad" : 1483,
                      "onLoad" : 4569
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "systemMetrics" : {
                      "cpuUtilization" : {
                        "min" : 0.22,
                        "median" : 0.61,
                        "max" : 0.75,
                        "mean" : 0.55,
                        "count" : 150,
                        "stdDev" : 0.01
                      },
                      "physicalMemoryTotalBytes" : 1024,
                      "startTimeMs" : 1581508857327,
                      "physicalMemoryUsedBytes" : {
                        "min" : 1.2,
                        "median" : 1.85,
                        "max" : 2.5,
                        "mean" : 1.77,
                        "count" : 155,
                        "stdDev" : 0.25
                      },
                      "endTimeMs" : 1581508867333
                    },
                    "pageTitle" : "Network Performance Resources | ThousandEyes",
                    "responseTime" : 240,
                    "pageUrl" : "https://app.thousandeyes.com/settings/integrations",
                    "id" : "07625:1490529480:aVDViw0i",
                    "pageId" : "C31gBrYJ",
                    "roundId" : 1384309800,
                    "loadDate" : "2022-07-17T22:00:54Z",
                    "responseCode" : 200
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.filter_real_user_tests_visited_pages_results(

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

            _headers=self.te_headers("filter_real_user_tests_visited_pages_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_filter_real_user_tests_visited_pages_results_error_400(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "errors" : [ {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  }, {
                    "code" : "code",
                    "field" : "field",
                    "message" : "message"
                  } ],
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(400)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="400"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_visited_pages_results_error_401(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_visited_pages_results_error_403(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_visited_pages_results_error_404(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_visited_pages_results_error_429(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_visited_pages_results_error_500(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_filter_real_user_tests_visited_pages_results_error_502(self) -> None:
        """Integration test for filter_real_user_tests_visited_pages_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "agentId" : [ "3fde6422-f119-40e1-ae32-d08a1243c038", "236e6f18-9637-4a2f-b15f-7aa6a29c9fce" ],
                  "bssid" : [ "8c:68:c8:a5:0a:8c", "0c:51:01:e4:3e:d0" ],
                  "visitedSite" : [ "app.thousandeyes.com" ],
                  "trigger" : [ "user" ],
                  "ssid" : [ "wifi-name", "other-room-wifi" ],
                  "platform" : [ "mac", "mac" ],
                  "proxyTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "destinationIp" : [ "84.255.241.1", "193.2.1.88" ],
                  "domain" : [ "thousandeyes.com" ],
                  "location" : [ "San Francisco Bay Area", "Germany" ],
                  "connection" : [ "wireless", "wireless" ],
                  "vpnTarget" : [ "78.153.54.204", "78.153.54.206" ],
                  "networkId" : [ "660b34109d12", "660b34109d15" ],
                  "gateway" : [ "78.153.54.204", "78.153.54.206" ]
                }
        
                """
        real_user_endpoint_test_result_request_filter = thousandeyes_sdk.endpoint_test_results.models.RealUserEndpointTestResultRequestFilter.from_json(request_body_json)
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.filter_real_user_tests_visited_pages_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                real_user_endpoint_test_result_request_filter=real_user_endpoint_test_result_request_filter,

                _headers=self.te_headers("filter_real_user_tests_visited_pages_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_get_real_user_test_page_results_happy_path(self) -> None:
        """Integration test for get_real_user_test_page_results success path"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        response_body_json = """
                {
                  "_links" : {
                    "self" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "har" : {
                    "log" : {
                      "browser" : {
                        "name" : "Google Chrome",
                        "version" : "57.0.2987.98"
                      },
                      "creator" : {
                        "name" : "ThousandEyes Endpoint Agent",
                        "version" : "0.47.0"
                      },
                      "entries" : [ {
                        "pageref" : "page_1",
                        "request" : {
                          "headers" : [ {
                            "name" : "Upgrade-Insecure-Requests",
                            "value" : "1"
                          }, {
                            "name" : "User-Agent",
                            "value" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"
                          }, {
                            "name" : "Accept",
                            "value" : "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
                          }, {
                            "name" : "Referer",
                            "value" : "https://www.thousandeyes.com/"
                          }, {
                            "name" : "Accept-Encoding",
                            "value" : "gzip, deflate, sdch, br"
                          }, {
                            "name" : "Accept-Language",
                            "value" : "en-US,en;q=0.6"
                          }, {
                            "name" : "Cookie",
                            "value" : "(removed)"
                          } ],
                          "method" : "GET",
                          "queryString" : [ {
                            "name" : "locale",
                            "value" : "en-US"
                          } ],
                          "url" : "https://www.thousandeyes.com/resources"
                        },
                        "response" : {
                          "bodySize" : 17776,
                          "content" : {
                            "mimeType" : "text/html;charset=ISO-8859-1",
                            "size" : 17776
                          },
                          "headers" : [ {
                            "name" : "Content-Type",
                            "value" : "text/html;charset=ISO-8859-1"
                          }, {
                            "name" : "Content-Length",
                            "value" : "17776"
                          }, {
                            "name" : "Connection",
                            "value" : "keep-alive"
                          }, {
                            "name" : "Date",
                            "value" : "Sun, 26 Mar 2017 11:58:54 GMT"
                          }, {
                            "name" : "Server",
                            "value" : "Apache"
                          }, {
                            "name" : "Cache-Control",
                            "value" : "max-age=600, must-revalidate"
                          }, {
                            "name" : "Content-Language",
                            "value" : "en-US"
                          }, {
                            "name" : "Content-Encoding",
                            "value" : "gzip"
                          }, {
                            "name" : "X-Frame-Options",
                            "value" : "sameorigin"
                          }, {
                            "name" : "Strict-Transport-Security",
                            "value" : "max-age=31536000"
                          }, {
                            "name" : "Vary",
                            "value" : "Accept-Encoding"
                          }, {
                            "name" : "X-Cache",
                            "value" : "Miss from cloudfront"
                          }, {
                            "name" : "Via",
                            "value" : "1.1 5dbe09af3a2c87121e31ffa67f174f66.cloudfront.net (CloudFront)"
                          }, {
                            "name" : "X-Amz-Cf-Id",
                            "value" : "YkvlkBNKgHt5aMu9vcS22Z8kHn1MUr-8adupwhDk3j9vF-TpSyIxZA=="
                          } ],
                          "headersSize" : 527,
                          "redirectURL" : "",
                          "status" : 200,
                          "statusText" : "OK"
                        },
                        "serverIPAddress" : "13.32.22.80",
                        "startedDateTime" : "2017-03-22T11:58:54.123+02:00",
                        "time" : 177,
                        "timings" : {
                          "blocked" : -1,
                          "connect" : -1,
                          "dns" : -1,
                          "receive" : 27,
                          "send" : -1,
                          "ssl" : -1,
                          "wait" : 150
                        }
                      }, {
                        "pageref" : "page_1",
                        "request" : {
                          "headers" : [ {
                            "name" : "User-Agent",
                            "value" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36"
                          }, {
                            "name" : "Accept",
                            "value" : "*/*"
                          }, {
                            "name" : "Referer",
                            "value" : "https://www.thousandeyes.com/resources"
                          }, {
                            "name" : "Accept-Encoding",
                            "value" : "gzip, deflate, sdch, br"
                          }, {
                            "name" : "Accept-Language",
                            "value" : "en-US,en;q=0.6"
                          } ],
                          "method" : "GET",
                          "queryString" : [ ],
                          "url" : "https://use.typekit.net/cjy5myw.js"
                        },
                        "response" : {
                          "bodySize" : 0,
                          "content" : {
                            "mimeType" : "text/javascript;charset=utf-8",
                            "size" : 7814
                          },
                          "headers" : [ {
                            "name" : "status",
                            "value" : "200"
                          }, {
                            "name" : "access-control-allow-origin",
                            "value" : "*"
                          }, {
                            "name" : "cache-control",
                            "value" : "public, max-age=600, stale-while-revalidate=604800"
                          }, {
                            "name" : "content-encoding",
                            "value" : "gzip"
                          }, {
                            "name" : "content-type",
                            "value" : "text/javascript;charset=utf-8"
                          }, {
                            "name" : "server",
                            "value" : "nginx"
                          }, {
                            "name" : "status",
                            "value" : "200 OK"
                          }, {
                            "name" : "timing-allow-origin",
                            "value" : "*"
                          }, {
                            "name" : "vary",
                            "value" : "Accept-Encoding"
                          }, {
                            "name" : "content-length",
                            "value" : "7814"
                          }, {
                            "name" : "date",
                            "value" : "Sun, 26 Mar 2017 11:58:43 GMT"
                          } ],
                          "headersSize" : 334,
                          "redirectURL" : "",
                          "status" : 200,
                          "statusText" : "OK"
                        },
                        "serverIPAddress" : "104.103.103.234",
                        "startedDateTime" : "2017-03-22T11:58:54.123+02:00",
                        "time" : 72,
                        "timings" : {
                          "blocked" : -1,
                          "connect" : -1,
                          "dns" : -1,
                          "receive" : 10,
                          "send" : -1,
                          "ssl" : -1,
                          "wait" : 62
                        }
                      } ],
                      "pages" : [ {
                        "id" : "page_1",
                        "pageTimings" : {
                          "onContentLoad" : 874,
                          "onLoad" : 3492
                        },
                        "responseCode" : 200,
                        "startedDateTime" : "2017-03-22T11:58:54.123+02:00",
                        "title" : "Network Performance Resources | ThousandEyes"
                      } ],
                      "version" : "1.2",
                      "systemMetrics" : {
                        "startTimeMs" : 1581508857327,
                        "endTimeMs" : 1581508867333,
                        "cpuUtilization" : {
                          "min" : 0.30859375,
                          "max" : 0.5625,
                          "mean" : 0.38931831001805056,
                          "median" : 0.353515625,
                          "stdDev" : 0.08389194281742307,
                          "count" : 10
                        },
                        "physicalMemoryUsedBytes" : {
                          "min" : 12805128192,
                          "max" : 12825530368,
                          "mean" : 1.281914582109091E10,
                          "median" : 12818219008,
                          "stdDev" : 5741124.05691331,
                          "count" : 11
                        },
                        "physicalMemoryTotalBytes" : 17069891584
                      }
                    }
                  }
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_real_user_test_page_results(

            id=id,

            page_id=page_id,

            aid=aid,

            _headers=self.te_headers("get_real_user_test_page_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_get_real_user_test_page_results_error_401(self) -> None:
        """Integration test for get_real_user_test_page_results error path (HTTP 401)"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.get_real_user_test_page_results(

                id=id,

                page_id=page_id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_page_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_page_results_error_403(self) -> None:
        """Integration test for get_real_user_test_page_results error path (HTTP 403)"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.get_real_user_test_page_results(

                id=id,

                page_id=page_id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_page_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_page_results_error_404(self) -> None:
        """Integration test for get_real_user_test_page_results error path (HTTP 404)"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.get_real_user_test_page_results(

                id=id,

                page_id=page_id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_page_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_page_results_error_429(self) -> None:
        """Integration test for get_real_user_test_page_results error path (HTTP 429)"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.get_real_user_test_page_results(

                id=id,

                page_id=page_id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_page_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_page_results_error_500(self) -> None:
        """Integration test for get_real_user_test_page_results error path (HTTP 500)"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.get_real_user_test_page_results(

                id=id,

                page_id=page_id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_page_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_page_results_error_502(self) -> None:
        """Integration test for get_real_user_test_page_results error path (HTTP 502)"""
        id = '07625:1490529480:h3qJQTpl'
        page_id = '281474976710706'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.get_real_user_test_page_results(

                id=id,

                page_id=page_id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_page_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)




    def test_get_real_user_test_results_happy_path(self) -> None:
        """Integration test for get_real_user_test_results success path"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        response_body_json = """
                {
                  "_links" : {
                    "self" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "results" : [ {
                    "date" : "2022-07-17T22:00:54Z",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "committed" : "2022-07-17T22:00:54Z",
                    "experienceScore" : 0.5,
                    "sourceAddress" : "84.255.241.1",
                    "organizationName" : "T-2 Access Network",
                    "visitedSite" : "www.thousandeyes.com",
                    "coordinates" : {
                      "latitude" : 46.0552778,
                      "location" : "Slovenia",
                      "longitude" : 14.5144444
                    },
                    "network" : {
                      "systemMetrics" : {
                        "cpuUtilization" : {
                          "min" : 0.22,
                          "median" : 0.61,
                          "max" : 0.75,
                          "mean" : 0.55,
                          "count" : 150,
                          "stdDev" : 0.01
                        },
                        "physicalMemoryTotalBytes" : 1024,
                        "startTimeMs" : 1581508857327,
                        "physicalMemoryUsedBytes" : {
                          "min" : 1.2,
                          "median" : 1.85,
                          "max" : 2.5,
                          "mean" : 1.77,
                          "count" : 155,
                          "stdDev" : 0.25
                        },
                        "endTimeMs" : 1581508867333
                      },
                      "isIcmpBlocked" : true,
                      "vpnPing" : {
                        "maxRtt" : 66,
                        "loss" : 1,
                        "pktsReceived" : 10,
                        "avgRtt" : 7,
                        "meanDevRtt" : 11,
                        "minRtt" : 1,
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "pktsSent" : 10
                      },
                      "ping" : {
                        "maxRtt" : 66,
                        "loss" : 1,
                        "pktsReceived" : 10,
                        "avgRtt" : 7,
                        "meanDevRtt" : 11,
                        "minRtt" : 1,
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "pktsSent" : 10
                      },
                      "networkProfile" : {
                        "previousInterface" : {
                          "publicIpAddress" : "84.255.241.1",
                          "publicIpRange" : "84.255.241.0-84.255.241.255",
                          "ipAddress" : "10.0.0.13",
                          "hardwareType" : "wireless",
                          "localPrefix" : "10.0.0.0",
                          "interfaceName" : "en0",
                          "subnetMask" : "255.255.255.0",
                          "dnsServers" : [ "8.8.8.8", "8.8.8.4" ]
                        },
                        "ethernetProfile" : {
                          "linkSpeed" : 860
                        },
                        "publicIpAddress" : "84.255.241.1",
                        "publicIpRange" : "84.255.241.0-84.255.241.255",
                        "ipAddress" : "10.0.0.13",
                        "hardwareType" : "wireless",
                        "localPrefix" : "10.0.0.0",
                        "proxyProfile" : {
                          "method" : "System",
                          "proxies" : [ {
                            "bypass" : "*.local;169.254/16",
                            "proxy" : "<direct>"
                          }, {
                            "bypass" : "*.local;169.254/16",
                            "proxy" : "<direct>"
                          } ]
                        },
                        "subnetMask" : "255.255.255.0",
                        "error" : "An operation timed out.",
                        "wirelessProfile" : {
                          "rssi" : -38,
                          "bssid" : "4c:ba:ba:f4:fa:fa",
                          "snr" : 57,
                          "vendor" : "Cisco",
                          "txRate" : 130,
                          "channel" : 1,
                          "noise" : -95,
                          "phyMode" : "802.11n",
                          "ssid" : "Internet for the masses",
                          "quality" : 100
                        },
                        "interfaceName" : "en0",
                        "dnsServers" : [ "8.8.8.8", "8.8.8.4" ],
                        "gateway" : "10.0.0.1"
                      },
                      "traceroute" : {
                        "destination" : "13.32.22.232",
                        "hops" : [ {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        }, {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        } ],
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
                      },
                      "vpnTraceroute" : {
                        "destination" : "13.32.22.232",
                        "hops" : [ {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        }, {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        } ],
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
                      },
                      "connectRtt" : 77.777,
                      "gatewayPing" : {
                        "maxRtt" : 66,
                        "loss" : 1,
                        "pktsReceived" : 10,
                        "avgRtt" : 7,
                        "meanDevRtt" : 11,
                        "minRtt" : 1,
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "pktsSent" : 10
                      },
                      "errors" : [ "ping: Request timed out before getting response" ]
                    },
                    "protocol" : "https",
                    "pages" : [ {
                      "pageTimings" : {
                        "onContentLoad" : 1483,
                        "onLoad" : 4569
                      },
                      "pageTitle" : "Network Performance Resources | ThousandEyes",
                      "pageUrl" : "https://app.thousandeyes.com/settings/integrations",
                      "pageId" : "C31gBrYJ",
                      "loadDate" : "2022-07-17T22:00:54Z",
                      "responseCode" : 200
                    }, {
                      "pageTimings" : {
                        "onContentLoad" : 1483,
                        "onLoad" : 4569
                      },
                      "pageTitle" : "Network Performance Resources | ThousandEyes",
                      "pageUrl" : "https://app.thousandeyes.com/settings/integrations",
                      "pageId" : "C31gBrYJ",
                      "loadDate" : "2022-07-17T22:00:54Z",
                      "responseCode" : 200
                    } ],
                    "numberOfPages" : 2,
                    "port" : 443,
                    "browser" : {
                      "name" : "Google Chrome",
                      "version" : "116.0.0.0"
                    },
                    "id" : "07625:1490529480:aVDViw0i",
                    "roundId" : 1384309800
                  }, {
                    "date" : "2022-07-17T22:00:54Z",
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "committed" : "2022-07-17T22:00:54Z",
                    "experienceScore" : 0.5,
                    "sourceAddress" : "84.255.241.1",
                    "organizationName" : "T-2 Access Network",
                    "visitedSite" : "www.thousandeyes.com",
                    "coordinates" : {
                      "latitude" : 46.0552778,
                      "location" : "Slovenia",
                      "longitude" : 14.5144444
                    },
                    "network" : {
                      "systemMetrics" : {
                        "cpuUtilization" : {
                          "min" : 0.22,
                          "median" : 0.61,
                          "max" : 0.75,
                          "mean" : 0.55,
                          "count" : 150,
                          "stdDev" : 0.01
                        },
                        "physicalMemoryTotalBytes" : 1024,
                        "startTimeMs" : 1581508857327,
                        "physicalMemoryUsedBytes" : {
                          "min" : 1.2,
                          "median" : 1.85,
                          "max" : 2.5,
                          "mean" : 1.77,
                          "count" : 155,
                          "stdDev" : 0.25
                        },
                        "endTimeMs" : 1581508867333
                      },
                      "isIcmpBlocked" : true,
                      "vpnPing" : {
                        "maxRtt" : 66,
                        "loss" : 1,
                        "pktsReceived" : 10,
                        "avgRtt" : 7,
                        "meanDevRtt" : 11,
                        "minRtt" : 1,
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "pktsSent" : 10
                      },
                      "ping" : {
                        "maxRtt" : 66,
                        "loss" : 1,
                        "pktsReceived" : 10,
                        "avgRtt" : 7,
                        "meanDevRtt" : 11,
                        "minRtt" : 1,
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "pktsSent" : 10
                      },
                      "networkProfile" : {
                        "previousInterface" : {
                          "publicIpAddress" : "84.255.241.1",
                          "publicIpRange" : "84.255.241.0-84.255.241.255",
                          "ipAddress" : "10.0.0.13",
                          "hardwareType" : "wireless",
                          "localPrefix" : "10.0.0.0",
                          "interfaceName" : "en0",
                          "subnetMask" : "255.255.255.0",
                          "dnsServers" : [ "8.8.8.8", "8.8.8.4" ]
                        },
                        "ethernetProfile" : {
                          "linkSpeed" : 860
                        },
                        "publicIpAddress" : "84.255.241.1",
                        "publicIpRange" : "84.255.241.0-84.255.241.255",
                        "ipAddress" : "10.0.0.13",
                        "hardwareType" : "wireless",
                        "localPrefix" : "10.0.0.0",
                        "proxyProfile" : {
                          "method" : "System",
                          "proxies" : [ {
                            "bypass" : "*.local;169.254/16",
                            "proxy" : "<direct>"
                          }, {
                            "bypass" : "*.local;169.254/16",
                            "proxy" : "<direct>"
                          } ]
                        },
                        "subnetMask" : "255.255.255.0",
                        "error" : "An operation timed out.",
                        "wirelessProfile" : {
                          "rssi" : -38,
                          "bssid" : "4c:ba:ba:f4:fa:fa",
                          "snr" : 57,
                          "vendor" : "Cisco",
                          "txRate" : 130,
                          "channel" : 1,
                          "noise" : -95,
                          "phyMode" : "802.11n",
                          "ssid" : "Internet for the masses",
                          "quality" : 100
                        },
                        "interfaceName" : "en0",
                        "dnsServers" : [ "8.8.8.8", "8.8.8.4" ],
                        "gateway" : "10.0.0.1"
                      },
                      "traceroute" : {
                        "destination" : "13.32.22.232",
                        "hops" : [ {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        }, {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        } ],
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
                      },
                      "vpnTraceroute" : {
                        "destination" : "13.32.22.232",
                        "hops" : [ {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        }, {
                          "delay" : 5,
                          "prefix" : "196.40.96.0/20",
                          "hop" : 1,
                          "ipAddress" : "196.40.106.237",
                          "name" : "89-210-88-65.access.t-2.net",
                          "mpls" : [ "L=301472,E=0,S=1,T=1" ],
                          "asn" : 34779
                        } ],
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "internalErrors" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ]
                      },
                      "connectRtt" : 77.777,
                      "gatewayPing" : {
                        "maxRtt" : 66,
                        "loss" : 1,
                        "pktsReceived" : 10,
                        "avgRtt" : 7,
                        "meanDevRtt" : 11,
                        "minRtt" : 1,
                        "error" : "An operation timed out.",
                        "infoFlags" : [ "TE_INFO_ICMP_BLOCKED_BY_FIREWALL" ],
                        "pktsSent" : 10
                      },
                      "errors" : [ "ping: Request timed out before getting response" ]
                    },
                    "protocol" : "https",
                    "pages" : [ {
                      "pageTimings" : {
                        "onContentLoad" : 1483,
                        "onLoad" : 4569
                      },
                      "pageTitle" : "Network Performance Resources | ThousandEyes",
                      "pageUrl" : "https://app.thousandeyes.com/settings/integrations",
                      "pageId" : "C31gBrYJ",
                      "loadDate" : "2022-07-17T22:00:54Z",
                      "responseCode" : 200
                    }, {
                      "pageTimings" : {
                        "onContentLoad" : 1483,
                        "onLoad" : 4569
                      },
                      "pageTitle" : "Network Performance Resources | ThousandEyes",
                      "pageUrl" : "https://app.thousandeyes.com/settings/integrations",
                      "pageId" : "C31gBrYJ",
                      "loadDate" : "2022-07-17T22:00:54Z",
                      "responseCode" : 200
                    } ],
                    "numberOfPages" : 2,
                    "port" : 443,
                    "browser" : {
                      "name" : "Google Chrome",
                      "version" : "116.0.0.0"
                    },
                    "id" : "07625:1490529480:aVDViw0i",
                    "roundId" : 1384309800
                  } ]
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_real_user_test_results(

            id=id,

            aid=aid,

            _headers=self.te_headers("get_real_user_test_results"),
        )
        assert_constructed_model_matches_example_json(response, expected_response)


    def test_get_real_user_test_results_error_401(self) -> None:
        """Integration test for get_real_user_test_results error path (HTTP 401)"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.get_real_user_test_results(

                id=id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_results", error_status="401"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_results_error_403(self) -> None:
        """Integration test for get_real_user_test_results error path (HTTP 403)"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.get_real_user_test_results(

                id=id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_results", error_status="403"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_results_error_404(self) -> None:
        """Integration test for get_real_user_test_results error path (HTTP 404)"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.get_real_user_test_results(

                id=id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_results", error_status="404"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_results_error_429(self) -> None:
        """Integration test for get_real_user_test_results error path (HTTP 429)"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.get_real_user_test_results(

                id=id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_results", error_status="429"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_results_error_500(self) -> None:
        """Integration test for get_real_user_test_results error path (HTTP 500)"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.get_real_user_test_results(

                id=id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_results", error_status="500"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)


    def test_get_real_user_test_results_error_502(self) -> None:
        """Integration test for get_real_user_test_results error path (HTTP 502)"""
        id = '07625:1490529480:h3qJQTpl'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 0
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(502)
        ) as context:
            self.api.get_real_user_test_results(

                id=id,

                aid=aid,

                _headers=self.te_headers("get_real_user_test_results", error_status="502"),
            )
        assert_constructed_model_matches_example_json(context.exception.data, expected_error)






if __name__ == '__main__':
    unittest.main()
