# coding: utf-8

"""
    Agents API

     ## Overview Manage Cloud and Enterprise Agents available to your account in ThousandEyes.

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

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


import json
import unittest
import thousandeyes_sdk.agents.models

from .test_utils import assert_constructed_model_matches_example_json
from thousandeyes_sdk.agents.api.local_problems_api import LocalProblemsApi


class TestLocalProblemsApi(unittest.TestCase):
    """LocalProblemsApi unit test stubs"""

    def setUp(self) -> None:
        self.api = LocalProblemsApi()

    def tearDown(self) -> None:
        pass

    def test_get_agents_local_problems_models_validation(self) -> None:
        """Test case for get_agents_local_problems request and response models"""

        response_body_json = """
                {
                  "endDate" : "2022-07-18T22:00:54Z",
                  "_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"
                    }
                  },
                  "localProblems" : [ {
                    "duration" : 480,
                    "agent" : {
                      "agentId" : "281474976710706",
                      "agentName" : "thousandeyes-stg-va-254",
                      "location" : "San Francisco Bay Area",
                      "countryId" : "US"
                    },
                    "endDate" : "2026-05-18T03:22:00Z",
                    "active" : false,
                    "startDate" : "2026-05-18T03:14:00Z"
                  }, {
                    "duration" : 480,
                    "agent" : {
                      "agentId" : "281474976710706",
                      "agentName" : "thousandeyes-stg-va-254",
                      "location" : "San Francisco Bay Area",
                      "countryId" : "US"
                    },
                    "endDate" : "2026-05-18T03:22:00Z",
                    "active" : false,
                    "startDate" : "2026-05-18T03:14:00Z"
                  } ],
                  "startDate" : "2022-07-17T22:00:54Z"
                }"""

        response_loaded_json = json.loads(response_body_json)
        response_from_json = thousandeyes_sdk.agents.models.LocalProblemAgentResults.from_json(response_body_json)
        assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)


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