# coding: utf-8

"""
    Hopsworks api

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

    OpenAPI spec version: 1.1.0-SNAPSHOT
    
    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 PythonEnvironmentLibraryResourceApi(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 delete1(self, library, version, project_id, **kwargs):  # noqa: E501
        """Delete commands for this library  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete1(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :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.delete1_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete1_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
            return data

    def delete1_with_http_info(self, library, version, project_id, **kwargs):  # noqa: E501
        """Delete commands for this library  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete1_with_http_info(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{library}/commands', 'DELETE',
            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 get1(self, library, version, project_id, **kwargs):  # noqa: E501
        """Get all commands for this library  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get1(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :param int offset:
        :param int limit:
        :param str sort_by: ex. sort_by=ID:asc,date_created:desc
        :param list[str] filter_by: ex. filter_by=op:create
        :return: CommandDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get1_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get1_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
            return data

    def get1_with_http_info(self, library, version, project_id, **kwargs):  # noqa: E501
        """Get all commands for this library  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get1_with_http_info(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :param int offset:
        :param int limit:
        :param str sort_by: ex. sort_by=ID:asc,date_created:desc
        :param list[str] filter_by: ex. filter_by=op:create
        :return: CommandDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['library', 'version', 'project_id', 'offset', 'limit', 'sort_by', 'filter_by']  # 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 get1" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'library' is set
        if ('library' not in params or
                params['library'] is None):
            raise ValueError("Missing the required parameter `library` when calling `get1`")  # noqa: E501
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `get1`")  # noqa: E501
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or
                params['project_id'] is None):
            raise ValueError("Missing the required parameter `project_id` when calling `get1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'sort_by' in params:
            query_params.append(('sort_by', params['sort_by']))  # noqa: E501
        if 'filter_by' in params:
            query_params.append(('filter_by', params['filter_by']))  # noqa: E501
            collection_formats['filter_by'] = 'multi'  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{library}/commands', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommandDTO',  # 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 get2(self, version, project_id, **kwargs):  # noqa: E501
        """Get the python libraries installed in this environment  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get2(version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version: (required)
        :param int project_id: (required)
        :param int offset:
        :param int limit:
        :param str sort_by: ex. sort_by=ID:asc,dependency:desc
        :param list[str] filter_by: ex. filter_by=preinstalled:1
        :param list[str] expand: ex. expand=commands
        :return: LibraryDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get2_with_http_info(version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get2_with_http_info(version, project_id, **kwargs)  # noqa: E501
            return data

    def get2_with_http_info(self, version, project_id, **kwargs):  # noqa: E501
        """Get the python libraries installed in this environment  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get2_with_http_info(version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str version: (required)
        :param int project_id: (required)
        :param int offset:
        :param int limit:
        :param str sort_by: ex. sort_by=ID:asc,dependency:desc
        :param list[str] filter_by: ex. filter_by=preinstalled:1
        :param list[str] expand: ex. expand=commands
        :return: LibraryDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['version', 'project_id', 'offset', 'limit', 'sort_by', 'filter_by', 'expand']  # 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 get2" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'version' is set
        if ('version' not in params or
                params['version'] is None):
            raise ValueError("Missing the required parameter `version` when calling `get2`")  # noqa: E501
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or
                params['project_id'] is None):
            raise ValueError("Missing the required parameter `project_id` when calling `get2`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'sort_by' in params:
            query_params.append(('sort_by', params['sort_by']))  # noqa: E501
        if 'filter_by' in params:
            query_params.append(('filter_by', params['filter_by']))  # noqa: E501
            collection_formats['filter_by'] = 'multi'  # noqa: E501
        if 'expand' in params:
            query_params.append(('expand', params['expand']))  # noqa: E501
            collection_formats['expand'] = 'multi'  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LibraryDTO',  # 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_by_name1(self, library, command_id, version, project_id, **kwargs):  # noqa: E501
        """Get command by id  # 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_by_name1(library, command_id, version, project_id, async_req=True)
        >>> result = thread.get()

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

    def get_by_name1_with_http_info(self, library, command_id, version, project_id, **kwargs):  # noqa: E501
        """Get command by id  # 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_by_name1_with_http_info(library, command_id, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param int command_id: (required)
        :param str version: (required)
        :param int project_id: (required)
        :return: CommandDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'command_id' in params:
            path_params['commandId'] = params['command_id']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_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(
            '/project/{projectId}/python/environments/{version}/libraries/{library}/commands/{commandId}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='CommandDTO',  # 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_by_name2(self, library, version, project_id, **kwargs):  # noqa: E501
        """Get the a python library installed in this environment  # 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_by_name2(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :param list[str] expand: ex. expand=commands
        :return: LibraryDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_by_name2_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_by_name2_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
            return data

    def get_by_name2_with_http_info(self, library, version, project_id, **kwargs):  # noqa: E501
        """Get the a python library installed in this environment  # 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_by_name2_with_http_info(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :param list[str] expand: ex. expand=commands
        :return: LibraryDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []
        if 'expand' in params:
            query_params.append(('expand', params['expand']))  # noqa: E501
            collection_formats['expand'] = 'multi'  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{library}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LibraryDTO',  # 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 install(self, library, version2, project_id, **kwargs):  # noqa: E501
        """Install a python library in the environment  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.install(library, version2, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version2: (required)
        :param int project_id: (required)
        :param str package_manager:
        :param str version:
        :param str channel:
        :param str machine:
        :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.install_with_http_info(library, version2, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.install_with_http_info(library, version2, project_id, **kwargs)  # noqa: E501
            return data

    def install_with_http_info(self, library, version2, project_id, **kwargs):  # noqa: E501
        """Install a python library in the environment  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.install_with_http_info(library, version2, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version2: (required)
        :param int project_id: (required)
        :param str package_manager:
        :param str version:
        :param str channel:
        :param str machine:
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['library', 'version2', 'project_id', 'package_manager', 'version', 'channel', 'machine']  # 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 install" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'library' is set
        if ('library' not in params or
                params['library'] is None):
            raise ValueError("Missing the required parameter `library` when calling `install`")  # noqa: E501
        # verify the required parameter 'version2' is set
        if ('version2' not in params or
                params['version2'] is None):
            raise ValueError("Missing the required parameter `version2` when calling `install`")  # noqa: E501
        # verify the required parameter 'project_id' is set
        if ('project_id' not in params or
                params['project_id'] is None):
            raise ValueError("Missing the required parameter `project_id` when calling `install`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'version2' in params:
            path_params['version'] = params['version2']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []
        if 'package_manager' in params:
            query_params.append(('package_manager', params['package_manager']))  # noqa: E501
        if 'version' in params:
            query_params.append(('version', params['version']))  # noqa: E501
        if 'channel' in params:
            query_params.append(('channel', params['channel']))  # noqa: E501
        if 'machine' in params:
            query_params.append(('machine', params['machine']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{library}', 'POST',
            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 search(self, search, version, project_id, **kwargs):  # noqa: E501
        """Search for libraries using conda or pip package managers  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search(search, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str search: (required)
        :param str version: (required)
        :param int project_id: (required)
        :param str query:
        :param str channel:
        :return: LibrarySearchDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.search_with_http_info(search, version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.search_with_http_info(search, version, project_id, **kwargs)  # noqa: E501
            return data

    def search_with_http_info(self, search, version, project_id, **kwargs):  # noqa: E501
        """Search for libraries using conda or pip package managers  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_with_http_info(search, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str search: (required)
        :param str version: (required)
        :param int project_id: (required)
        :param str query:
        :param str channel:
        :return: LibrarySearchDTO
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'search' in params:
            path_params['search'] = params['search']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []
        if 'query' in params:
            query_params.append(('query', params['query']))  # noqa: E501
        if 'channel' in params:
            query_params.append(('channel', params['channel']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{search}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='LibrarySearchDTO',  # 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 uninstall(self, library, version, project_id, **kwargs):  # noqa: E501
        """Uninstall a python library from the environment  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.uninstall(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :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.uninstall_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.uninstall_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
            return data

    def uninstall_with_http_info(self, library, version, project_id, **kwargs):  # noqa: E501
        """Uninstall a python library from the environment  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.uninstall_with_http_info(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{library}', 'DELETE',
            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 update(self, library, version, project_id, **kwargs):  # noqa: E501
        """Update commands for this library  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :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.update_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
        else:
            (data) = self.update_with_http_info(library, version, project_id, **kwargs)  # noqa: E501
            return data

    def update_with_http_info(self, library, version, project_id, **kwargs):  # noqa: E501
        """Update commands for this library  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_with_http_info(library, version, project_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str library: (required)
        :param str version: (required)
        :param int project_id: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'library' in params:
            path_params['library'] = params['library']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # noqa: E501
        if 'project_id' in params:
            path_params['projectId'] = params['project_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/project/{projectId}/python/environments/{version}/libraries/{library}/commands', 'PUT',
            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)
