# coding: utf-8

"""
    Dashboards API

    Manage ThousandEyes Dashboards.

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

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


import json
import unittest
import thousandeyes_sdk.dashboards.models

from thousandeyes_sdk.core.exceptions import ApiException
from thousandeyes_sdk.dashboards.api.dashboards_filters_api import DashboardsFiltersApi
from .integration_test_utils import IntegrationTestBase
from .test_utils import assert_constructed_model_matches_example_json


class TestDashboardsFiltersApiIntegration(IntegrationTestBase):
    """DashboardsFiltersApi integration test stubs"""

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


    def test_create_dashboard_filter_happy_path(self) -> None:
        """Integration test for create_dashboard_filter success path"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        response_body_json = """
                {
                  "createdDate" : "2024-02-01T22:19:19Z",
                  "createdBy" : {
                    "uid" : "1",
                    "name" : "Test User"
                  },
                  "_links" : {
                    "self" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "modifiedDate" : "2024-02-01T22:19:19Z",
                  "description" : "Global filter for CEA widgets",
                  "modifiedBy" : {
                    "uid" : "1",
                    "name" : "Test User"
                  },
                  "id" : "65bc18e8f2073a4a469cd958",
                  "aid" : "11"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.create_dashboard_filter(

            api_context_filter_request=api_context_filter_request,

            aid=aid,

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


    def test_create_dashboard_filter_error_400(self) -> None:
        """Integration test for create_dashboard_filter error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        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.create_dashboard_filter(

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_create_dashboard_filter_error_401(self) -> None:
        """Integration test for create_dashboard_filter error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.create_dashboard_filter(

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_create_dashboard_filter_error_403(self) -> None:
        """Integration test for create_dashboard_filter error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.create_dashboard_filter(

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_create_dashboard_filter_error_404(self) -> None:
        """Integration test for create_dashboard_filter error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.create_dashboard_filter(

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_create_dashboard_filter_error_429(self) -> None:
        """Integration test for create_dashboard_filter error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.create_dashboard_filter(

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_create_dashboard_filter_error_500(self) -> None:
        """Integration test for create_dashboard_filter error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.create_dashboard_filter(

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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




    def test_delete_dashboard_filter_happy_path(self) -> None:
        """Integration test for delete_dashboard_filter success path"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        response = self.api.delete_dashboard_filter_with_http_info(

            id=id,

            aid=aid,

            _headers=self.te_headers("delete_dashboard_filter"),
        )
        self.assertEqual(204, response.status_code)
        self.assertIsNone(response.data)


    def test_delete_dashboard_filter_error_400(self) -> None:
        """Integration test for delete_dashboard_filter error path (HTTP 400)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        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.delete_dashboard_filter(

                id=id,

                aid=aid,

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


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

                id=id,

                aid=aid,

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


    def test_delete_dashboard_filter_error_403(self) -> None:
        """Integration test for delete_dashboard_filter error path (HTTP 403)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.delete_dashboard_filter(

                id=id,

                aid=aid,

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


    def test_delete_dashboard_filter_error_404(self) -> None:
        """Integration test for delete_dashboard_filter error path (HTTP 404)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.delete_dashboard_filter(

                id=id,

                aid=aid,

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


    def test_delete_dashboard_filter_error_429(self) -> None:
        """Integration test for delete_dashboard_filter error path (HTTP 429)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.delete_dashboard_filter(

                id=id,

                aid=aid,

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


    def test_delete_dashboard_filter_error_500(self) -> None:
        """Integration test for delete_dashboard_filter error path (HTTP 500)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.delete_dashboard_filter(

                id=id,

                aid=aid,

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




    def test_get_dashboard_filter_happy_path(self) -> None:
        """Integration test for get_dashboard_filter success path"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        response_body_json = """
                {
                  "createdDate" : "2024-02-01T22:19:19Z",
                  "createdBy" : {
                    "uid" : "1",
                    "name" : "Test User"
                  },
                  "_links" : {
                    "self" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "modifiedDate" : "2024-02-01T22:19:19Z",
                  "description" : "Global filter for CEA widgets",
                  "modifiedBy" : {
                    "uid" : "1",
                    "name" : "Test User"
                  },
                  "id" : "65bc18e8f2073a4a469cd958",
                  "aid" : "11"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_dashboard_filter(

            id=id,

            aid=aid,

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


    def test_get_dashboard_filter_error_400(self) -> None:
        """Integration test for get_dashboard_filter error path (HTTP 400)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        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_dashboard_filter(

                id=id,

                aid=aid,

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


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

                id=id,

                aid=aid,

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


    def test_get_dashboard_filter_error_403(self) -> None:
        """Integration test for get_dashboard_filter error path (HTTP 403)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.get_dashboard_filter(

                id=id,

                aid=aid,

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


    def test_get_dashboard_filter_error_404(self) -> None:
        """Integration test for get_dashboard_filter error path (HTTP 404)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.get_dashboard_filter(

                id=id,

                aid=aid,

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


    def test_get_dashboard_filter_error_429(self) -> None:
        """Integration test for get_dashboard_filter error path (HTTP 429)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.get_dashboard_filter(

                id=id,

                aid=aid,

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


    def test_get_dashboard_filter_error_500(self) -> None:
        """Integration test for get_dashboard_filter error path (HTTP 500)"""
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.get_dashboard_filter(

                id=id,

                aid=aid,

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




    def test_get_dashboards_filters_happy_path(self) -> None:
        """Integration test for get_dashboards_filters success path"""
        search_pattern = 'cea-filter'
        aid = '1234'
        response_body_json = """
                {
                  "dashboardFilters" : [ {
                    "createdDate" : "2024-02-01T22:19:19Z",
                    "createdBy" : {
                      "uid" : "1",
                      "name" : "Test User"
                    },
                    "_links" : {
                      "self" : {
                        "hreflang" : "hreflang",
                        "templated" : true,
                        "profile" : "profile",
                        "name" : "name",
                        "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                        "type" : "type",
                        "deprecation" : "deprecation",
                        "title" : "title"
                      }
                    },
                    "context" : [ {
                      "dataSourceId" : "VIRTUAL_AGENT",
                      "filters" : [ {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      }, {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      } ]
                    }, {
                      "dataSourceId" : "VIRTUAL_AGENT",
                      "filters" : [ {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      }, {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      } ]
                    } ],
                    "name" : "cea-filter",
                    "modifiedDate" : "2024-02-01T22:19:19Z",
                    "description" : "Global filter for CEA widgets",
                    "modifiedBy" : {
                      "uid" : "1",
                      "name" : "Test User"
                    },
                    "id" : "65bc18e8f2073a4a469cd958",
                    "aid" : "11"
                  }, {
                    "createdDate" : "2024-02-01T22:19:19Z",
                    "createdBy" : {
                      "uid" : "1",
                      "name" : "Test User"
                    },
                    "_links" : {
                      "self" : {
                        "hreflang" : "hreflang",
                        "templated" : true,
                        "profile" : "profile",
                        "name" : "name",
                        "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                        "type" : "type",
                        "deprecation" : "deprecation",
                        "title" : "title"
                      }
                    },
                    "context" : [ {
                      "dataSourceId" : "VIRTUAL_AGENT",
                      "filters" : [ {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      }, {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      } ]
                    }, {
                      "dataSourceId" : "VIRTUAL_AGENT",
                      "filters" : [ {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      }, {
                        "filterId" : "TEST_LABEL",
                        "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                        "values" : [ "45862", "59749" ]
                      } ]
                    } ],
                    "name" : "cea-filter",
                    "modifiedDate" : "2024-02-01T22:19:19Z",
                    "description" : "Global filter for CEA widgets",
                    "modifiedBy" : {
                      "uid" : "1",
                      "name" : "Test User"
                    },
                    "id" : "65bc18e8f2073a4a469cd958",
                    "aid" : "11"
                  } ]
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.get_dashboards_filters(

            search_pattern=search_pattern,

            aid=aid,

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


    def test_get_dashboards_filters_error_400(self) -> None:
        """Integration test for get_dashboards_filters error path (HTTP 400)"""
        search_pattern = 'cea-filter'
        aid = '1234'
        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_dashboards_filters(

                search_pattern=search_pattern,

                aid=aid,

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


    def test_get_dashboards_filters_error_401(self) -> None:
        """Integration test for get_dashboards_filters error path (HTTP 401)"""
        search_pattern = 'cea-filter'
        aid = '1234'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.get_dashboards_filters(

                search_pattern=search_pattern,

                aid=aid,

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


    def test_get_dashboards_filters_error_403(self) -> None:
        """Integration test for get_dashboards_filters error path (HTTP 403)"""
        search_pattern = 'cea-filter'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.get_dashboards_filters(

                search_pattern=search_pattern,

                aid=aid,

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


    def test_get_dashboards_filters_error_404(self) -> None:
        """Integration test for get_dashboards_filters error path (HTTP 404)"""
        search_pattern = 'cea-filter'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.get_dashboards_filters(

                search_pattern=search_pattern,

                aid=aid,

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


    def test_get_dashboards_filters_error_429(self) -> None:
        """Integration test for get_dashboards_filters error path (HTTP 429)"""
        search_pattern = 'cea-filter'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.get_dashboards_filters(

                search_pattern=search_pattern,

                aid=aid,

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


    def test_get_dashboards_filters_error_500(self) -> None:
        """Integration test for get_dashboards_filters error path (HTTP 500)"""
        search_pattern = 'cea-filter'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.get_dashboards_filters(

                search_pattern=search_pattern,

                aid=aid,

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




    def test_update_dashboard_filter_happy_path(self) -> None:
        """Integration test for update_dashboard_filter success path"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        response_body_json = """
                {
                  "createdDate" : "2024-02-01T22:19:19Z",
                  "createdBy" : {
                    "uid" : "1",
                    "name" : "Test User"
                  },
                  "_links" : {
                    "self" : {
                      "hreflang" : "hreflang",
                      "templated" : true,
                      "profile" : "profile",
                      "name" : "name",
                      "href" : "https://api.thousandeyes.com/v7/link/to/resource/id",
                      "type" : "type",
                      "deprecation" : "deprecation",
                      "title" : "title"
                    }
                  },
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "modifiedDate" : "2024-02-01T22:19:19Z",
                  "description" : "Global filter for CEA widgets",
                  "modifiedBy" : {
                    "uid" : "1",
                    "name" : "Test User"
                  },
                  "id" : "65bc18e8f2073a4a469cd958",
                  "aid" : "11"
                }
                """
        expected_response = json.loads(response_body_json)
        response = self.api.update_dashboard_filter(

            id=id,

            api_context_filter_request=api_context_filter_request,

            aid=aid,

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


    def test_update_dashboard_filter_error_400(self) -> None:
        """Integration test for update_dashboard_filter error path (HTTP 400)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        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.update_dashboard_filter(

                id=id,

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_update_dashboard_filter_error_401(self) -> None:
        """Integration test for update_dashboard_filter error path (HTTP 401)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "error_description" : "Invalid access token",
                  "error" : "invalid_token"
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(401)
        ) as context:
            self.api.update_dashboard_filter(

                id=id,

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_update_dashboard_filter_error_403(self) -> None:
        """Integration test for update_dashboard_filter error path (HTTP 403)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(403)
        ) as context:
            self.api.update_dashboard_filter(

                id=id,

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_update_dashboard_filter_error_404(self) -> None:
        """Integration test for update_dashboard_filter error path (HTTP 404)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(404)
        ) as context:
            self.api.update_dashboard_filter(

                id=id,

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_update_dashboard_filter_error_429(self) -> None:
        """Integration test for update_dashboard_filter error path (HTTP 429)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(429)
        ) as context:
            self.api.update_dashboard_filter(

                id=id,

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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


    def test_update_dashboard_filter_error_500(self) -> None:
        """Integration test for update_dashboard_filter error path (HTTP 500)"""
        request_body_json = """
        
                {
                  "context" : [ {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  }, {
                    "dataSourceId" : "VIRTUAL_AGENT",
                    "filters" : [ {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    }, {
                      "filterId" : "TEST_LABEL",
                      "metricIds" : [ "WEB_PAGE_LOAD_COMPLETION_RATE", "WEB_TTFB", "WEB_AVAILABILITY" ],
                      "values" : [ "45862", "59749" ]
                    } ]
                  } ],
                  "name" : "cea-filter",
                  "description" : "Global filter for CEA widgets"
                }
        
                """
        api_context_filter_request = thousandeyes_sdk.dashboards.models.ApiContextFilterRequest.from_json(request_body_json)
        id = '65bc18e8f2073a4a469cd958'
        aid = '1234'
        error_body_json = """
                {
                  "instance" : "instance",
                  "detail" : "detail",
                  "type" : "type",
                  "title" : "title",
                  "status" : 6
                }
                """
        expected_error = json.loads(error_body_json)
        with self.assertRaises(
            ApiException.exception_class_for_http_status(500)
        ) as context:
            self.api.update_dashboard_filter(

                id=id,

                api_context_filter_request=api_context_filter_request,

                aid=aid,

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






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