# coding: utf-8

"""
    SevOne API Documentation

    Supported endpoints by the new RESTful API  # noqa: E501

    OpenAPI spec version: 2.1.18, Hash: db562e6
    
    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 swagger_client.api_client import ApiClient


class DynamicPluginApi(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 register_dynamic_plugin(self, id, dynamic_plugin_dto, **kwargs):  # noqa: E501
        """Register plugin in dynamic plugin manager  # noqa: E501

        Register plugin in dynamic plugin manager  # 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_dynamic_plugin(id, dynamic_plugin_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the pluginmanager (required)
        :param DynamicPluginRequestDto dynamic_plugin_dto: Plugin request object (required)
        :return: DynamicPluginResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.register_dynamic_plugin_with_http_info(id, dynamic_plugin_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.register_dynamic_plugin_with_http_info(id, dynamic_plugin_dto, **kwargs)  # noqa: E501
            return data

    def register_dynamic_plugin_with_http_info(self, id, dynamic_plugin_dto, **kwargs):  # noqa: E501
        """Register plugin in dynamic plugin manager  # noqa: E501

        Register plugin in dynamic plugin manager  # 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_dynamic_plugin_with_http_info(id, dynamic_plugin_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the pluginmanager (required)
        :param DynamicPluginRequestDto dynamic_plugin_dto: Plugin request object (required)
        :return: DynamicPluginResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'dynamic_plugin_dto']  # 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_dynamic_plugin" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if ('id' not in params or
                params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `register_dynamic_plugin`")  # noqa: E501
        # verify the required parameter 'dynamic_plugin_dto' is set
        if ('dynamic_plugin_dto' not in params or
                params['dynamic_plugin_dto'] is None):
            raise ValueError("Missing the required parameter `dynamic_plugin_dto` when calling `register_dynamic_plugin`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'dynamic_plugin_dto' in params:
            body_params = params['dynamic_plugin_dto']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/pluginmanager/{id}/plugin/register', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DynamicPluginResponseDto',  # 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_dynamic_plugin1(self, id, dynamic_plugin_dto, **kwargs):  # noqa: E501
        """Register plugin in dynamic plugin manager  # noqa: E501

        Register plugin in dynamic plugin manager  # 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_dynamic_plugin1(id, dynamic_plugin_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the pluginmanager (required)
        :param DynamicPluginRequestDto dynamic_plugin_dto: Plugin request object (required)
        :return: DynamicPluginResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.register_dynamic_plugin1_with_http_info(id, dynamic_plugin_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.register_dynamic_plugin1_with_http_info(id, dynamic_plugin_dto, **kwargs)  # noqa: E501
            return data

    def register_dynamic_plugin1_with_http_info(self, id, dynamic_plugin_dto, **kwargs):  # noqa: E501
        """Register plugin in dynamic plugin manager  # noqa: E501

        Register plugin in dynamic plugin manager  # 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_dynamic_plugin1_with_http_info(id, dynamic_plugin_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the pluginmanager (required)
        :param DynamicPluginRequestDto dynamic_plugin_dto: Plugin request object (required)
        :return: DynamicPluginResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'dynamic_plugin_dto']  # 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_dynamic_plugin1" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if ('id' not in params or
                params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `register_dynamic_plugin1`")  # noqa: E501
        # verify the required parameter 'dynamic_plugin_dto' is set
        if ('dynamic_plugin_dto' not in params or
                params['dynamic_plugin_dto'] is None):
            raise ValueError("Missing the required parameter `dynamic_plugin_dto` when calling `register_dynamic_plugin1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'dynamic_plugin_dto' in params:
            body_params = params['dynamic_plugin_dto']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/pluginmanager/{id}/plugin/register', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DynamicPluginResponseDto',  # 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_dynamic_plugin_manager(self, dynamic_plugin_manager_dto, **kwargs):  # noqa: E501
        """Register dynamic plugin manager  # noqa: E501

        Registers new dynamic plugin manager  # 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_dynamic_plugin_manager(dynamic_plugin_manager_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DynamicPluginManagerRequestDto dynamic_plugin_manager_dto: Dynamic Plugin Manager request object (required)
        :return: DynamicPluginManagerResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.register_dynamic_plugin_manager_with_http_info(dynamic_plugin_manager_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.register_dynamic_plugin_manager_with_http_info(dynamic_plugin_manager_dto, **kwargs)  # noqa: E501
            return data

    def register_dynamic_plugin_manager_with_http_info(self, dynamic_plugin_manager_dto, **kwargs):  # noqa: E501
        """Register dynamic plugin manager  # noqa: E501

        Registers new dynamic plugin manager  # 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_dynamic_plugin_manager_with_http_info(dynamic_plugin_manager_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DynamicPluginManagerRequestDto dynamic_plugin_manager_dto: Dynamic Plugin Manager request object (required)
        :return: DynamicPluginManagerResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['dynamic_plugin_manager_dto']  # 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_dynamic_plugin_manager" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'dynamic_plugin_manager_dto' is set
        if ('dynamic_plugin_manager_dto' not in params or
                params['dynamic_plugin_manager_dto'] is None):
            raise ValueError("Missing the required parameter `dynamic_plugin_manager_dto` when calling `register_dynamic_plugin_manager`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'dynamic_plugin_manager_dto' in params:
            body_params = params['dynamic_plugin_manager_dto']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/pluginmanager/register', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DynamicPluginManagerResponseDto',  # 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_dynamic_plugin_manager1(self, dynamic_plugin_manager_dto, **kwargs):  # noqa: E501
        """Register dynamic plugin manager  # noqa: E501

        Registers new dynamic plugin manager  # 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_dynamic_plugin_manager1(dynamic_plugin_manager_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DynamicPluginManagerRequestDto dynamic_plugin_manager_dto: Dynamic Plugin Manager request object (required)
        :return: DynamicPluginManagerResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.register_dynamic_plugin_manager1_with_http_info(dynamic_plugin_manager_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.register_dynamic_plugin_manager1_with_http_info(dynamic_plugin_manager_dto, **kwargs)  # noqa: E501
            return data

    def register_dynamic_plugin_manager1_with_http_info(self, dynamic_plugin_manager_dto, **kwargs):  # noqa: E501
        """Register dynamic plugin manager  # noqa: E501

        Registers new dynamic plugin manager  # 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_dynamic_plugin_manager1_with_http_info(dynamic_plugin_manager_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param DynamicPluginManagerRequestDto dynamic_plugin_manager_dto: Dynamic Plugin Manager request object (required)
        :return: DynamicPluginManagerResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['dynamic_plugin_manager_dto']  # 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_dynamic_plugin_manager1" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'dynamic_plugin_manager_dto' is set
        if ('dynamic_plugin_manager_dto' not in params or
                params['dynamic_plugin_manager_dto'] is None):
            raise ValueError("Missing the required parameter `dynamic_plugin_manager_dto` when calling `register_dynamic_plugin_manager1`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'dynamic_plugin_manager_dto' in params:
            body_params = params['dynamic_plugin_manager_dto']
        # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/pluginmanager/register', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DynamicPluginManagerResponseDto',  # 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)
