# coding: utf-8

"""
    VNS3 Controller API

    Cohesive networks VNS3 API providing complete control of your network's addresses, routes, rules and edge  # noqa: E501

    The version of the OpenAPI document: 4.8
    Contact: solutions@cohesive.net
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import datetime
import pytest

from tests.rest_mock import RestClientMock

from cohesivenet import VNS3Client, models, Configuration
from cohesivenet.rest import ApiException


class TestMonitoringAlertingApi(object):
    """MonitoringAlertingApi unit test stubs"""

    def test_delete_alert(self):
        """Test case for delete_alert

        """
        pass

    def test_get_alert(self):
        """Test case for get_alert

        """
        pass

    def test_get_alerts(self):
        """Test case for get_alerts

        """
        pass

    def test_post_define_new_alert(self):
        """Test case for post_define_new_alert

        """
        pass

    def test_post_test_alert(self):
        """Test case for post_test_alert

        """
        pass

    def test_post_toggle_enabled_alert(self):
        """Test case for post_toggle_enabled_alert

        """
        pass

    def test_put_update_alert(self):
        """Test case for put_update_alert

        """
        pass

    def test_delete_webhook(self):
        """Test case for delete_webhook

        """
        pass

    def test_get_webhook(self):
        """Test case for get_webhook

        """
        pass

    def test_get_webhooks(self, rest_mock: RestClientMock):
        """Test case for get_webhooks

        """
        method, uri = "get", "/api/webhooks"
        rest_mock.stub_request(
            method,
            uri,
            {
                "response": [
                    {
                        "body": "{\n"
                        '    "attachments": [{\n'
                        '      "author_name": "Tunnel %{status}: '
                        '%{tunnel_description}",\n'
                        '      "author_link": "%{tunnel_url}",\n'
                        '      "fields": [\n'
                        '        {"title": "VNS3 Controller", "value": '
                        '"%{topo_name}" , "short": true},\n'
                        '        {"title": "Endpoint", "value": "%{ipsec_name} '
                        '(%{ipsec_ip})", "short": true},\n'
                        '        {"title": "Local Subnet", "value": '
                        '"%{local_subnet}", "short": true},\n'
                        '        {"title": "Remote Subnet", "value": '
                        '"%{remote_subnet}", "short": true}\n'
                        "      ]\n"
                        "    }]\n"
                        "  }",
                        "created_at": "2019-11-12T16:03:28.554000",
                        "custom_properties": [],
                        "events": ["tunnel_up", "tunnel_down"],
                        "headers": [],
                        "id": 2,
                        "name": "Test Slack",
                        "parameters": [],
                        "updated_at": "2019-11-12T16:03:28.554000",
                        "url": "",
                        "validate_cert": True,
                    }
                ]
            },
        )

        api_client = VNS3Client(
            configuration=Configuration(
                host="0.0.0.0:8000",
                username="api",
                password="password",
                verify_ssl=False,
            )
        )

        resp = api_client.monitoring.get_webhooks()
        assert type(resp) is models.WebhooksListResponse
        assert resp.response[0].id == 2

    def test_post_create_webhook(self):
        """Test case for post_create_webhook

        """
        pass

    def test_put_update_webhook(self):
        """Test case for put_update_webhook

        """
        pass
