# 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 re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from cohesivenet.exceptions import ApiTypeError, ApiValueError


class IPsecApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            from cohesivenet.vns3_client import VNS3Client

            api_client = VNS3Client()
        self.api_client = api_client

    def delete_ipsec_endpoint(self, endpoint_id, **kwargs):  # noqa: E501
        """delete_ipsec_endpoint  # noqa: E501

        Delete IPsec endpoint  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_ipsec_endpoint(endpoint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.delete_ipsec_endpoint_with_http_info(
            endpoint_id, **kwargs
        )  # noqa: E501

    def delete_ipsec_endpoint_with_http_info(self, endpoint_id, **kwargs):  # noqa: E501
        """delete_ipsec_endpoint  # noqa: E501

        Delete IPsec endpoint  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_ipsec_endpoint_with_http_info(endpoint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["endpoint_id"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_ipsec_endpoint" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'endpoint_id' is set
        if (
            "endpoint_id" not in local_var_params
            or local_var_params["endpoint_id"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `endpoint_id` when calling `delete_ipsec_endpoint`"
            )  # noqa: E501

        if (
            "endpoint_id" in local_var_params and local_var_params["endpoint_id"] < 0
        ):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `endpoint_id` when calling `delete_ipsec_endpoint`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if "endpoint_id" in local_var_params:
            path_params["endpoint_id"] = local_var_params["endpoint_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints/{endpoint_id}",
            "DELETE",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="object",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def delete_ipsec_endpoint_tunnel(
        self, endpoint_id, tunnel_id, **kwargs
    ):  # noqa: E501
        """delete_ipsec_endpoint_tunnel  # noqa: E501

        Delete IPsec tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_ipsec_endpoint_tunnel(endpoint_id, tunnel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param int tunnel_id: ID for tunnel (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.delete_ipsec_endpoint_tunnel_with_http_info(
            endpoint_id, tunnel_id, **kwargs
        )  # noqa: E501

    def delete_ipsec_endpoint_tunnel_with_http_info(
        self, endpoint_id, tunnel_id, **kwargs
    ):  # noqa: E501
        """delete_ipsec_endpoint_tunnel  # noqa: E501

        Delete IPsec tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_ipsec_endpoint_tunnel_with_http_info(endpoint_id, tunnel_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param int tunnel_id: ID for tunnel (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["endpoint_id", "tunnel_id"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_ipsec_endpoint_tunnel" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'endpoint_id' is set
        if (
            "endpoint_id" not in local_var_params
            or local_var_params["endpoint_id"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `endpoint_id` when calling `delete_ipsec_endpoint_tunnel`"
            )  # noqa: E501
        # verify the required parameter 'tunnel_id' is set
        if "tunnel_id" not in local_var_params or local_var_params["tunnel_id"] is None:
            raise ApiValueError(
                "Missing the required parameter `tunnel_id` when calling `delete_ipsec_endpoint_tunnel`"
            )  # noqa: E501

        if (
            "endpoint_id" in local_var_params and local_var_params["endpoint_id"] < 0
        ):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `endpoint_id` when calling `delete_ipsec_endpoint_tunnel`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if "endpoint_id" in local_var_params:
            path_params["endpoint_id"] = local_var_params["endpoint_id"]  # noqa: E501
        if "tunnel_id" in local_var_params:
            path_params["tunnel_id"] = local_var_params["tunnel_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints/{endpoint_id}/tunnels/{tunnel_id}",
            "DELETE",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="object",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def get_ipsec(self, **kwargs):  # noqa: E501
        """get_ipsec  # noqa: E501

        Get details for all IPsec endpoints/subnets  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ipsec(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: IpsecSystemDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.get_ipsec_with_http_info(**kwargs)  # noqa: E501

    def get_ipsec_with_http_info(self, **kwargs):  # noqa: E501
        """get_ipsec  # noqa: E501

        Get details for all IPsec endpoints/subnets  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ipsec_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(IpsecSystemDetail, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = []  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_ipsec" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="IpsecSystemDetail",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def get_ipsec_endpoint(self, endpoint_id, **kwargs):  # noqa: E501
        """get_ipsec_endpoint  # noqa: E501

        Get IPsec endpoint information  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ipsec_endpoint(endpoint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.get_ipsec_endpoint_with_http_info(
            endpoint_id, **kwargs
        )  # noqa: E501

    def get_ipsec_endpoint_with_http_info(self, endpoint_id, **kwargs):  # noqa: E501
        """get_ipsec_endpoint  # noqa: E501

        Get IPsec endpoint information  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ipsec_endpoint_with_http_info(endpoint_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["endpoint_id"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_ipsec_endpoint" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'endpoint_id' is set
        if (
            "endpoint_id" not in local_var_params
            or local_var_params["endpoint_id"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `endpoint_id` when calling `get_ipsec_endpoint`"
            )  # noqa: E501

        if (
            "endpoint_id" in local_var_params and local_var_params["endpoint_id"] < 0
        ):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `endpoint_id` when calling `get_ipsec_endpoint`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if "endpoint_id" in local_var_params:
            path_params["endpoint_id"] = local_var_params["endpoint_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints/{endpoint_id}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="object",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def get_ipsec_status(self, **kwargs):  # noqa: E501
        """get_ipsec_status  # noqa: E501

        Describe ipsec tunnels status  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ipsec_status(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: IpsecTunnelListResponseKeyValue
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.get_ipsec_status_with_http_info(**kwargs)  # noqa: E501

    def get_ipsec_status_with_http_info(self, **kwargs):  # noqa: E501
        """get_ipsec_status  # noqa: E501

        Describe ipsec tunnels status  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ipsec_status_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(IpsecTunnelListResponseKeyValue, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = []  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_ipsec_status" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/status/ipsec",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="IpsecTunnelListResponseKeyValue",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def get_link_history(self, **kwargs):  # noqa: E501
        """get_link_history  # noqa: E501

        Provides information about the connection history of the subnet or tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_link_history(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str remote: Address string in CIDR format to display link history to a remote endpoint.
        :param str local: Address string in CIDR format which will display status of the local route
        :param int tunnelid: Will display link history of just the tunnel specified, which may be only one tunnel to a remote endpoint.
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: LinkHistoryDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.get_link_history_with_http_info(**kwargs)  # noqa: E501

    def get_link_history_with_http_info(self, **kwargs):  # noqa: E501
        """get_link_history  # noqa: E501

        Provides information about the connection history of the subnet or tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_link_history_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str remote: Address string in CIDR format to display link history to a remote endpoint.
        :param str local: Address string in CIDR format which will display status of the local route
        :param int tunnelid: Will display link history of just the tunnel specified, which may be only one tunnel to a remote endpoint.
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(LinkHistoryDetail, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["remote", "local", "tunnelid"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_link_history" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]

        collection_formats = {}

        path_params = {}

        query_params = []
        if "remote" in local_var_params:
            query_params.append(("remote", local_var_params["remote"]))  # noqa: E501
        if "local" in local_var_params:
            query_params.append(("local", local_var_params["local"]))  # noqa: E501
        if "tunnelid" in local_var_params:
            query_params.append(
                ("tunnelid", local_var_params["tunnelid"])
            )  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/status/link_history",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="LinkHistoryDetail",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def post_create_ipsec_endpoint(
        self, create_ipsec_endpoint_request, **kwargs
    ):  # noqa: E501
        """post_create_ipsec_endpoint  # noqa: E501

        Create IPsec connection to the defined remote gateway  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_create_ipsec_endpoint(create_ipsec_endpoint_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param CreateIpsecEndpointRequest create_ipsec_endpoint_request: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: IpsecRemoteEndpointDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.post_create_ipsec_endpoint_with_http_info(
            create_ipsec_endpoint_request, **kwargs
        )  # noqa: E501

    def post_create_ipsec_endpoint_with_http_info(
        self, create_ipsec_endpoint_request, **kwargs
    ):  # noqa: E501
        """post_create_ipsec_endpoint  # noqa: E501

        Create IPsec connection to the defined remote gateway  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_create_ipsec_endpoint_with_http_info(create_ipsec_endpoint_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param CreateIpsecEndpointRequest create_ipsec_endpoint_request: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(IpsecRemoteEndpointDetail, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["create_ipsec_endpoint_request"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method post_create_ipsec_endpoint" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'create_ipsec_endpoint_request' is set
        if (
            "create_ipsec_endpoint_request" not in local_var_params
            or local_var_params["create_ipsec_endpoint_request"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `create_ipsec_endpoint_request` when calling `post_create_ipsec_endpoint`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "create_ipsec_endpoint_request" in local_var_params:
            body_params = local_var_params["create_ipsec_endpoint_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"
        ] = self.api_client.select_header_content_type(  # noqa: E501
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="IpsecRemoteEndpointDetail",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def post_create_ipsec_endpoint_tunnel(
        self, endpoint_id, create_ipsec_tunnel_request, **kwargs
    ):  # noqa: E501
        """post_create_ipsec_endpoint_tunnel  # noqa: E501

        Create IPsec endpoint tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_create_ipsec_endpoint_tunnel(endpoint_id, create_ipsec_tunnel_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param CreateIpsecTunnelRequest create_ipsec_tunnel_request: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.post_create_ipsec_endpoint_tunnel_with_http_info(
            endpoint_id, create_ipsec_tunnel_request, **kwargs
        )  # noqa: E501

    def post_create_ipsec_endpoint_tunnel_with_http_info(
        self, endpoint_id, create_ipsec_tunnel_request, **kwargs
    ):  # noqa: E501
        """post_create_ipsec_endpoint_tunnel  # noqa: E501

        Create IPsec endpoint tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_create_ipsec_endpoint_tunnel_with_http_info(endpoint_id, create_ipsec_tunnel_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param CreateIpsecTunnelRequest create_ipsec_tunnel_request: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["endpoint_id", "create_ipsec_tunnel_request"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method post_create_ipsec_endpoint_tunnel" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'endpoint_id' is set
        if (
            "endpoint_id" not in local_var_params
            or local_var_params["endpoint_id"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `endpoint_id` when calling `post_create_ipsec_endpoint_tunnel`"
            )  # noqa: E501
        # verify the required parameter 'create_ipsec_tunnel_request' is set
        if (
            "create_ipsec_tunnel_request" not in local_var_params
            or local_var_params["create_ipsec_tunnel_request"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `create_ipsec_tunnel_request` when calling `post_create_ipsec_endpoint_tunnel`"
            )  # noqa: E501

        if (
            "endpoint_id" in local_var_params and local_var_params["endpoint_id"] < 0
        ):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `endpoint_id` when calling `post_create_ipsec_endpoint_tunnel`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if "endpoint_id" in local_var_params:
            path_params["endpoint_id"] = local_var_params["endpoint_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "create_ipsec_tunnel_request" in local_var_params:
            body_params = local_var_params["create_ipsec_tunnel_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"
        ] = self.api_client.select_header_content_type(  # noqa: E501
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints/{endpoint_id}/tunnels",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="object",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def post_restart_ipsec_action(self, restart_request, **kwargs):  # noqa: E501
        """post_restart_ipsec_action  # noqa: E501

        Restart ipsec subystem  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_restart_ipsec_action(restart_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param RestartRequest restart_request: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: RestartStatus
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.post_restart_ipsec_action_with_http_info(
            restart_request, **kwargs
        )  # noqa: E501

    def post_restart_ipsec_action_with_http_info(
        self, restart_request, **kwargs
    ):  # noqa: E501
        """post_restart_ipsec_action  # noqa: E501

        Restart ipsec subystem  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.post_restart_ipsec_action_with_http_info(restart_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param RestartRequest restart_request: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(RestartStatus, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["restart_request"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method post_restart_ipsec_action" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'restart_request' is set
        if (
            "restart_request" not in local_var_params
            or local_var_params["restart_request"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `restart_request` when calling `post_restart_ipsec_action`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "restart_request" in local_var_params:
            body_params = local_var_params["restart_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"
        ] = self.api_client.select_header_content_type(  # noqa: E501
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="RestartStatus",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def put_edit_ipsec_endpoint(
        self, endpoint_id, update_ipsec_connection_request, **kwargs
    ):  # noqa: E501
        """put_edit_ipsec_endpoint  # noqa: E501

        Edit IPsec connection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_edit_ipsec_endpoint(endpoint_id, update_ipsec_connection_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param UpdateIpsecConnectionRequest update_ipsec_connection_request: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.put_edit_ipsec_endpoint_with_http_info(
            endpoint_id, update_ipsec_connection_request, **kwargs
        )  # noqa: E501

    def put_edit_ipsec_endpoint_with_http_info(
        self, endpoint_id, update_ipsec_connection_request, **kwargs
    ):  # noqa: E501
        """put_edit_ipsec_endpoint  # noqa: E501

        Edit IPsec connection  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_edit_ipsec_endpoint_with_http_info(endpoint_id, update_ipsec_connection_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param UpdateIpsecConnectionRequest update_ipsec_connection_request: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["endpoint_id", "update_ipsec_connection_request"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method put_edit_ipsec_endpoint" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'endpoint_id' is set
        if (
            "endpoint_id" not in local_var_params
            or local_var_params["endpoint_id"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `endpoint_id` when calling `put_edit_ipsec_endpoint`"
            )  # noqa: E501
        # verify the required parameter 'update_ipsec_connection_request' is set
        if (
            "update_ipsec_connection_request" not in local_var_params
            or local_var_params["update_ipsec_connection_request"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `update_ipsec_connection_request` when calling `put_edit_ipsec_endpoint`"
            )  # noqa: E501

        if (
            "endpoint_id" in local_var_params and local_var_params["endpoint_id"] < 0
        ):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `endpoint_id` when calling `put_edit_ipsec_endpoint`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if "endpoint_id" in local_var_params:
            path_params["endpoint_id"] = local_var_params["endpoint_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "update_ipsec_connection_request" in local_var_params:
            body_params = local_var_params["update_ipsec_connection_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"
        ] = self.api_client.select_header_content_type(  # noqa: E501
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints/{endpoint_id}",
            "PUT",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="object",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def put_edit_ipsec_endpoint_tunnel(
        self, endpoint_id, tunnel_id, update_ipsec_tunnel_request, **kwargs
    ):  # noqa: E501
        """put_edit_ipsec_endpoint_tunnel  # noqa: E501

        Edit IPsec endpoint tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_edit_ipsec_endpoint_tunnel(endpoint_id, tunnel_id, update_ipsec_tunnel_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param int tunnel_id: ID for tunnel (required)
        :param UpdateIpsecTunnelRequest update_ipsec_tunnel_request: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: IpsecTunnelDetail
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.put_edit_ipsec_endpoint_tunnel_with_http_info(
            endpoint_id, tunnel_id, update_ipsec_tunnel_request, **kwargs
        )  # noqa: E501

    def put_edit_ipsec_endpoint_tunnel_with_http_info(
        self, endpoint_id, tunnel_id, update_ipsec_tunnel_request, **kwargs
    ):  # noqa: E501
        """put_edit_ipsec_endpoint_tunnel  # noqa: E501

        Edit IPsec endpoint tunnel  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_edit_ipsec_endpoint_tunnel_with_http_info(endpoint_id, tunnel_id, update_ipsec_tunnel_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int endpoint_id: ID for IPsec endpoint (required)
        :param int tunnel_id: ID for tunnel (required)
        :param UpdateIpsecTunnelRequest update_ipsec_tunnel_request: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(IpsecTunnelDetail, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            "endpoint_id",
            "tunnel_id",
            "update_ipsec_tunnel_request",
        ]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method put_edit_ipsec_endpoint_tunnel" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'endpoint_id' is set
        if (
            "endpoint_id" not in local_var_params
            or local_var_params["endpoint_id"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `endpoint_id` when calling `put_edit_ipsec_endpoint_tunnel`"
            )  # noqa: E501
        # verify the required parameter 'tunnel_id' is set
        if "tunnel_id" not in local_var_params or local_var_params["tunnel_id"] is None:
            raise ApiValueError(
                "Missing the required parameter `tunnel_id` when calling `put_edit_ipsec_endpoint_tunnel`"
            )  # noqa: E501
        # verify the required parameter 'update_ipsec_tunnel_request' is set
        if (
            "update_ipsec_tunnel_request" not in local_var_params
            or local_var_params["update_ipsec_tunnel_request"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `update_ipsec_tunnel_request` when calling `put_edit_ipsec_endpoint_tunnel`"
            )  # noqa: E501

        if (
            "endpoint_id" in local_var_params and local_var_params["endpoint_id"] < 0
        ):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `endpoint_id` when calling `put_edit_ipsec_endpoint_tunnel`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}
        if "endpoint_id" in local_var_params:
            path_params["endpoint_id"] = local_var_params["endpoint_id"]  # noqa: E501
        if "tunnel_id" in local_var_params:
            path_params["tunnel_id"] = local_var_params["tunnel_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "update_ipsec_tunnel_request" in local_var_params:
            body_params = local_var_params["update_ipsec_tunnel_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"
        ] = self.api_client.select_header_content_type(  # noqa: E501
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec/endpoints/{endpoint_id}/tunnels/{tunnel_id}",
            "PUT",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="IpsecTunnelDetail",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )

    def put_ipsec_config(self, update_ipsec_address_request, **kwargs):  # noqa: E501
        """put_ipsec_config  # noqa: E501

        Edit Ipsec Configuration on device. Note, This is device wide and must be set before  any remote endpoint definitions are created. If it needs to be changed, all remote endpoint  information and tunnel information must be deleted first.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_ipsec_config(update_ipsec_address_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param UpdateIpsecAddressRequest update_ipsec_address_request: (required)
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: object
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs["_return_http_data_only"] = True
        return self.put_ipsec_config_with_http_info(
            update_ipsec_address_request, **kwargs
        )  # noqa: E501

    def put_ipsec_config_with_http_info(
        self, update_ipsec_address_request, **kwargs
    ):  # noqa: E501
        """put_ipsec_config  # noqa: E501

        Edit Ipsec Configuration on device. Note, This is device wide and must be set before  any remote endpoint definitions are created. If it needs to be changed, all remote endpoint  information and tunnel information must be deleted first.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.put_ipsec_config_with_http_info(update_ipsec_address_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param UpdateIpsecAddressRequest update_ipsec_address_request: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["update_ipsec_address_request"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method put_ipsec_config" % key
                )
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'update_ipsec_address_request' is set
        if (
            "update_ipsec_address_request" not in local_var_params
            or local_var_params["update_ipsec_address_request"] is None
        ):
            raise ApiValueError(
                "Missing the required parameter `update_ipsec_address_request` when calling `put_ipsec_config`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "update_ipsec_address_request" in local_var_params:
            body_params = local_var_params["update_ipsec_address_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json"]
        )  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"
        ] = self.api_client.select_header_content_type(  # noqa: E501
            ["application/json"]
        )  # noqa: E501

        # Authentication setting
        auth_settings = ["basicAuth"]  # noqa: E501

        return self.api_client.call_api(
            "/ipsec",
            "PUT",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="object",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"
            ),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )
