# 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.http_server_endpoint_scheduled_test_results_api import HTTPServerEndpointScheduledTestResultsApi
from .integration_test_utils import IntegrationTestBase
from .test_utils import assert_constructed_model_matches_example_json


class TestHTTPServerEndpointScheduledTestResultsApiIntegration(IntegrationTestBase):
    """HTTPServerEndpointScheduledTestResultsApi integration test stubs"""

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


    def test_get_http_server_scheduled_test_results_happy_path(self) -> None:
        """Integration test for get_http_server_scheduled_test_results success path"""
        test_id = '202701'
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        response_body_json = """
                {
                  "test" : {
                    "server" : "www.example.com",
                    "isSavedEvent" : false,
                    "sslVersion" : "Auto",
                    "useNtlm" : false,
                    "_links" : {
                      "testResults" : [ {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/network/filter"
                      }, {
                        "href" : "https://api.thousandeyes.com/v7/endpoint/test-results/scheduled-tests/281474976710706/pathvis"
                      } ],
                      "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"
                      }
                    },
                    "isPrioritized" : false,
                    "httpTimeLimit" : 5000,
                    "type" : "http-server",
                    "protocol" : "icmp",
                    "httpVersion" : 2,
                    "followRedirects" : true,
                    "authType" : "none",
                    "testName" : "Test name",
                    "verifyCertificate" : true,
                    "networkMeasurements" : true,
                    "tcpProbeMode" : "auto",
                    "url" : "https://example.com:443",
                    "labels" : [ {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    }, {
                      "labelId" : "961",
                      "name" : "Artem label",
                      "isBuiltin" : false
                    } ],
                    "createdDate" : "2022-07-17T22:00:54Z",
                    "ipVersion" : "V4_ONLY",
                    "port" : 443,
                    "isEnabled" : true,
                    "modifiedDate" : "2022-07-17T22:00:54Z",
                    "interval" : 60,
                    "testId" : "281474976710706",
                    "aid" : "1234",
                    "agentSelectorConfig" : {
                      "agentSelectorType" : "all-agents",
                      "maxMachines" : 25
                    },
                    "hasPathTraceInSession" : true,
                    "httpTargetTime" : 100,
                    "username" : "username",
                    "sslVersionId" : "0"
                  },
                  "totalHits" : 12,
                  "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"
                    },
                    "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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "numRedirects" : 0,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "errorType" : "connect",
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "responseCode" : 200,
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "connectTime" : 2,
                    "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"
                    },
                    "throughput" : 190,
                    "roundId" : 1384309800,
                    "headers" : {
                      "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n",
                      "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n"
                    },
                    "redirectTime" : 10,
                    "responseTime" : 14,
                    "totalTime" : 15,
                    "receiveTime" : 1,
                    "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
                    },
                    "dnsTime" : 0,
                    "serverIp" : "193.2.1.88",
                    "testId" : "584739201",
                    "sslTime" : 9,
                    "aid" : "1234",
                    "waitTime" : 3,
                    "errorDetails" : "errorDetails",
                    "wireSize" : 9993
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "numRedirects" : 0,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "errorType" : "connect",
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "responseCode" : 200,
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "connectTime" : 2,
                    "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"
                    },
                    "throughput" : 190,
                    "roundId" : 1384309800,
                    "headers" : {
                      "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n",
                      "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n"
                    },
                    "redirectTime" : 10,
                    "responseTime" : 14,
                    "totalTime" : 15,
                    "receiveTime" : 1,
                    "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
                    },
                    "dnsTime" : 0,
                    "serverIp" : "193.2.1.88",
                    "testId" : "584739201",
                    "sslTime" : 9,
                    "aid" : "1234",
                    "waitTime" : 3,
                    "errorDetails" : "errorDetails",
                    "wireSize" : 9993
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_http_server_scheduled_test_results(

            test_id=test_id,

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

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


    def test_get_http_server_scheduled_test_results_error_401(self) -> None:
        """Integration test for get_http_server_scheduled_test_results error path (HTTP 401)"""
        test_id = '202701'
        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.get_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

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


    def test_get_http_server_scheduled_test_results_error_403(self) -> None:
        """Integration test for get_http_server_scheduled_test_results error path (HTTP 403)"""
        test_id = '202701'
        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.get_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

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


    def test_get_http_server_scheduled_test_results_error_404(self) -> None:
        """Integration test for get_http_server_scheduled_test_results error path (HTTP 404)"""
        test_id = '202701'
        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.get_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

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


    def test_get_http_server_scheduled_test_results_error_429(self) -> None:
        """Integration test for get_http_server_scheduled_test_results error path (HTTP 429)"""
        test_id = '202701'
        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.get_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

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


    def test_get_http_server_scheduled_test_results_error_500(self) -> None:
        """Integration test for get_http_server_scheduled_test_results error path (HTTP 500)"""
        test_id = '202701'
        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.get_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

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


    def test_get_http_server_scheduled_test_results_error_502(self) -> None:
        """Integration test for get_http_server_scheduled_test_results error path (HTTP 502)"""
        test_id = '202701'
        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.get_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

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




    def test_get_multi_test_filtered_http_server_scheduled_test_results_happy_path(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results success path"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        response_body_json = """
                {
                  "totalHits" : 12,
                  "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"
                    },
                    "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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "numRedirects" : 0,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "errorType" : "connect",
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "responseCode" : 200,
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "connectTime" : 2,
                    "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"
                    },
                    "throughput" : 190,
                    "roundId" : 1384309800,
                    "headers" : {
                      "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n",
                      "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n"
                    },
                    "redirectTime" : 10,
                    "responseTime" : 14,
                    "totalTime" : 15,
                    "receiveTime" : 1,
                    "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
                    },
                    "dnsTime" : 0,
                    "serverIp" : "193.2.1.88",
                    "testId" : "584739201",
                    "sslTime" : 9,
                    "aid" : "1234",
                    "waitTime" : 3,
                    "errorDetails" : "errorDetails",
                    "wireSize" : 9993
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "numRedirects" : 0,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "errorType" : "connect",
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "responseCode" : 200,
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "connectTime" : 2,
                    "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"
                    },
                    "throughput" : 190,
                    "roundId" : 1384309800,
                    "headers" : {
                      "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n",
                      "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n"
                    },
                    "redirectTime" : 10,
                    "responseTime" : 14,
                    "totalTime" : 15,
                    "receiveTime" : 1,
                    "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
                    },
                    "dnsTime" : 0,
                    "serverIp" : "193.2.1.88",
                    "testId" : "584739201",
                    "sslTime" : 9,
                    "aid" : "1234",
                    "waitTime" : 3,
                    "errorDetails" : "errorDetails",
                    "wireSize" : 9993
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_multi_test_filtered_http_server_scheduled_test_results(

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            use_all_permitted_aids=use_all_permitted_aids,

            http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_400(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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.get_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_401(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_403(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_404(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_429(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_500(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_multi_test_filtered_http_server_scheduled_test_results_error_502(self) -> None:
        """Integration test for get_multi_test_filtered_http_server_scheduled_test_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.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'
        use_all_permitted_aids = False
        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_multi_test_filtered_http_server_scheduled_test_results(

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                use_all_permitted_aids=use_all_permitted_aids,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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




    def test_get_single_test_filtered_http_server_scheduled_test_results_happy_path(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results success path"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        aid = '1234'
        window = '12h'
        start_date = '2022-07-17T22:00:54Z'
        end_date = '2022-07-18T22:00:54Z'
        cursor = 'cursor_example'
        response_body_json = """
                {
                  "totalHits" : 12,
                  "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"
                    },
                    "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" : [ {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "numRedirects" : 0,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "errorType" : "connect",
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "responseCode" : 200,
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "connectTime" : 2,
                    "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"
                    },
                    "throughput" : 190,
                    "roundId" : 1384309800,
                    "headers" : {
                      "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n",
                      "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n"
                    },
                    "redirectTime" : 10,
                    "responseTime" : 14,
                    "totalTime" : 15,
                    "receiveTime" : 1,
                    "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
                    },
                    "dnsTime" : 0,
                    "serverIp" : "193.2.1.88",
                    "testId" : "584739201",
                    "sslTime" : 9,
                    "aid" : "1234",
                    "waitTime" : 3,
                    "errorDetails" : "errorDetails",
                    "wireSize" : 9993
                  }, {
                    "originalTargetProfile" : {
                      "protocol" : "tcp",
                      "remotePort" : 80,
                      "remoteIpAddress" : "120.98.134.7"
                    },
                    "agentId" : "861b7557-cd57-4bbb-b648-00bddf88ef49",
                    "numRedirects" : 0,
                    "vpnProfile" : {
                      "vpnClientNetworkRange" : [ "9.88.37.27", "9.88.37.27" ],
                      "vpnGatewayAddress" : "120.98.134.7",
                      "vpnType" : "cisco-anyconnect",
                      "vpnClientAddresses" : [ "184.81.113.85", "13.129.91.62" ]
                    },
                    "errorType" : "connect",
                    "batteryMetrics" : {
                      "batteryHealthNormalizedPercent" : 0.92,
                      "batteryLevel" : "medium",
                      "batteryLevelNormalizedPercent" : 0.3
                    },
                    "userProfile" : {
                      "userName" : "joeblogs32",
                      "userPrincipalName" : "joeblogs32@c.com"
                    },
                    "platform" : "mac",
                    "responseCode" : 200,
                    "cellularProfile" : {
                      "rssi" : -10,
                      "advertisedNetworkSubtype" : "LTE/HSPA",
                      "carrierName" : "T-Mobile",
                      "rsrq" : -30,
                      "rsrp" : -30,
                      "advertisedNetworkGen" : "2g, 3g, 4g, 5g",
                      "rscp" : -30,
                      "networkGen" : "2g, 3g, 4g, 5g",
                      "networkSubtype" : "LTE/HSPA",
                      "sinr" : 20
                    },
                    "score" : {
                      "applicationScore" : 100,
                      "quality" : "great"
                    },
                    "connectTime" : 2,
                    "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"
                    },
                    "throughput" : 190,
                    "roundId" : 1384309800,
                    "headers" : {
                      "requestHeaders" : "GET / HTTP/1.1\\r\\nHost: www.thousandeyes.com\\r\\nUser-Agent: curl/7.58.0-DEV\\r\\nAccept: */*\\r\\nAccept-Encoding: deflate, gzip\\r\\nX-ThousandEyes-Agent: yes\\r\\n",
                      "responseHeaders" : "HTTP/1.1 200 OK\\r\\nContent-Type: text/html;charset=UTF-8\\r\\nContent-Length: 9993\\r\\nConnection: keep-alive\\r\\nDate: Mon, 04 May 2020 16:13:00 GMT\\r\\nServer: Apache\\r\\nContent-Language: en-US\\r\\nContent-Encoding: gzip\\r\\nX-Frame-Options: sameorigin\\r\\nCache-Control: max-age=600, must-revalidate\\r\\nStrict-Transport-Security: max-age=31536000\\r\\nX-Content-Type-Options: nosniff\\r\\nX-XSS-Protection: 1; mode=block\\r\\nVary: Accept-Encoding\\r\\nX-Cache: Hit from cloudfront\\r\\nVia: 1.1 7ba3caf71ae7a52dd411d1a543e80cd8.cloudfront.net (CloudFront)\\r\\nX-Amz-Cf-Pop: SFO5-C3\\r\\nX-Amz-Cf-Id: w4h42tkoJD-rEpkRDZUvnQBmy26GVGe6pUsuRr1Dphf7oajYbjXaOA==\\r\\nAge: 132\\r\\n"
                    },
                    "redirectTime" : 10,
                    "responseTime" : 14,
                    "totalTime" : 15,
                    "receiveTime" : 1,
                    "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
                    },
                    "dnsTime" : 0,
                    "serverIp" : "193.2.1.88",
                    "testId" : "584739201",
                    "sslTime" : 9,
                    "aid" : "1234",
                    "waitTime" : 3,
                    "errorDetails" : "errorDetails",
                    "wireSize" : 9993
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_single_test_filtered_http_server_scheduled_test_results(

            test_id=test_id,

            aid=aid,

            window=window,

            start_date=start_date,

            end_date=end_date,

            cursor=cursor,

            http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_400(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_401(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_403(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_404(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_429(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_500(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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


    def test_get_single_test_filtered_http_server_scheduled_test_results_error_502(self) -> None:
        """Integration test for get_single_test_filtered_http_server_scheduled_test_results error path (HTTP 502)"""
        request_body_json = """
        
                {
                  "searchSort" : [ {
                    "sort" : "round-id",
                    "order" : "desc"
                  }, {
                    "sort" : "round-id",
                    "order" : "desc"
                  } ],
                  "searchFilters" : {
                    "agentId" : [ "52455b09-ff1b-4849-8194-99026cc890e0", "52455b09-ff1b-4849-8194-99026cc890e0" ],
                    "testId" : [ "5", "5" ],
                    "userPrincipalName" : [ "joeblogs32@c.com", "joeblogs32@c.com" ]
                  },
                  "thresholdFilter" : {
                    "conditionalOperator" : "and",
                    "filters" : [ {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    }, {
                      "name" : "response-time",
                      "value" : 10,
                      "operator" : "gte"
                    } ]
                  }
                }
        
                """
        http_endpoint_tests_data_rounds_search = thousandeyes_sdk.endpoint_test_results.models.HttpEndpointTestsDataRoundsSearch.from_json(request_body_json)
        test_id = '202701'
        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.get_single_test_filtered_http_server_scheduled_test_results(

                test_id=test_id,

                aid=aid,

                window=window,

                start_date=start_date,

                end_date=end_date,

                cursor=cursor,

                http_endpoint_tests_data_rounds_search=http_endpoint_tests_data_rounds_search,

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






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