# coding: utf-8

"""
    AristaFlowREST/LicenceManager

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 2.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from af_licence_manager.api_client import ApiClient


class AristaFlowServiceApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # 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_release(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ServiceRelease
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_release_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_release_with_http_info(**kwargs)  # noqa: E501
            return data

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # 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_release_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ServiceRelease
                 If the method is called asynchronously,
                 returns the request thread.
        """

        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')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_release" % key
                )
            params[key] = val
        del 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 = []  # noqa: E501

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

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # 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_service_instance_name(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ServiceInstanceName
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_service_instance_name_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_service_instance_name_with_http_info(**kwargs)  # noqa: E501
            return data

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # 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_service_instance_name_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: ServiceInstanceName
                 If the method is called asynchronously,
                 returns the request thread.
        """

        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')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_service_instance_name" % key
                )
            params[key] = val
        del 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/service-instance-name', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ServiceInstanceName',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # 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_uris(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[str]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_uris_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_uris_with_http_info(**kwargs)  # noqa: E501
            return data

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # 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_uris_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: list[str]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        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')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_uris" % key
                )
            params[key] = val
        del 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/uris', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[str]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.ping(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: int
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.ping_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.ping_with_http_info(**kwargs)  # noqa: E501
            return data

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

        This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.ping_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: int
                 If the method is called asynchronously,
                 returns the request thread.
        """

        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')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method ping" % key
                )
            params[key] = val
        del 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/start-time', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='int',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

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

        This operation registers an SSE connection which can be used for server events by all services. There will be a start event named SseConnectionEstablished sending the ID of the connection as plain text. This ID needs to be provided when starting service-specific notifications. Please unregister the SSE connection instead of simply closing it. This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.register_sse(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.register_sse_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.register_sse_with_http_info(**kwargs)  # noqa: E501
            return data

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

        This operation registers an SSE connection which can be used for server events by all services. There will be a start event named SseConnectionEstablished sending the ID of the connection as plain text. This ID needs to be provided when starting service-specific notifications. Please unregister the SSE connection instead of simply closing it. This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.register_sse_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        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')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method register_sse" % key
                )
            params[key] = val
        del 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(
            ['text/event-stream', 'application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

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

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

        This operation unregisters the SSE connection and releases all server-side resources. This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.unregister_sse(sse_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sse_id: (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.unregister_sse_with_http_info(sse_id, **kwargs)  # noqa: E501
        else:
            (data) = self.unregister_sse_with_http_info(sse_id, **kwargs)  # noqa: E501
            return data

    def unregister_sse_with_http_info(self, sse_id, **kwargs):  # noqa: E501
        """unregister_sse  # noqa: E501

        This operation unregisters the SSE connection and releases all server-side resources. This operation has additional header data: x-AF-Accept-Version (optional). See operation /header-data for the corresponding data structures.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.unregister_sse_with_http_info(sse_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sse_id: (required)
        :return: bool
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['sse_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')

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

        collection_formats = {}

        path_params = {}
        if 'sse_id' in params:
            path_params['sseId'] = params['sse_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 = []  # noqa: E501

        return self.api_client.call_api(
            '/sse/{sseId}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='bool',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
