# coding: utf-8

"""
    42di API Reference

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

    OpenAPI spec version: 1.0
    Contact: support@42docs.com
    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 BoardsApi(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 create_topic(self, board_id, **kwargs):  # noqa: E501
        """Create Topic  # noqa: E501

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

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param Topic body: The **Topic** object will be created.
        :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.create_topic_with_http_info(board_id, **kwargs)  # noqa: E501
        else:
            (data) = self.create_topic_with_http_info(board_id, **kwargs)  # noqa: E501
            return data

    def create_topic_with_http_info(self, board_id, **kwargs):  # noqa: E501
        """Create Topic  # noqa: E501

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

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param Topic body: The **Topic** object will be created.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/boards/{board_id}/topics', '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 delete_topic(self, board_id, topic_id, **kwargs):  # noqa: E501
        """Delete Topic  # 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_topic(board_id, topic_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param str topic_id: the **Topic** identity (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.delete_topic_with_http_info(board_id, topic_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_topic_with_http_info(board_id, topic_id, **kwargs)  # noqa: E501
            return data

    def delete_topic_with_http_info(self, board_id, topic_id, **kwargs):  # noqa: E501
        """Delete Topic  # 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_topic_with_http_info(board_id, topic_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param str topic_id: the **Topic** identity (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/boards/{board_id}/topics/{topic_id}', '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 get_board(self, board_id, **kwargs):  # noqa: E501
        """Get Board  # 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_board(board_id, async_req=True)
        >>> result = thread.get()

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

    def get_board_with_http_info(self, board_id, **kwargs):  # noqa: E501
        """Get Board  # 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_board_with_http_info(board_id, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'board_id' in params:
            path_params['board_id'] = params['board_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 = ['BearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/boards/{board_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Board',  # 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_topic(self, board_id, topic_id, **kwargs):  # noqa: E501
        """Get Topic  # 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_topic(board_id, topic_id, async_req=True)
        >>> result = thread.get()

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

    def get_topic_with_http_info(self, board_id, topic_id, **kwargs):  # noqa: E501
        """Get Topic  # 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_topic_with_http_info(board_id, topic_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param str topic_id: the **Topic** identity (required)
        :return: Topic
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'board_id' in params:
            path_params['board_id'] = params['board_id']  # noqa: E501
        if 'topic_id' in params:
            path_params['topic_id'] = params['topic_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 = ['BearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/boards/{board_id}/topics/{topic_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Topic',  # 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 list_topics(self, board_id, **kwargs):  # noqa: E501
        """List Topics  # noqa: E501

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

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

    def list_topics_with_http_info(self, board_id, **kwargs):  # noqa: E501
        """List Topics  # noqa: E501

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

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :return: list[Topic]
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'board_id' in params:
            path_params['board_id'] = params['board_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 = ['BearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/boards/{board_id}/topics', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Topic]',  # 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_topic_property(self, board_id, topic_id, **kwargs):  # noqa: E501
        """Update Topic property  # 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_topic_property(board_id, topic_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param str topic_id: the **Topic** identity (required)
        :param PatchAction body: PATCH Action
        :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_topic_property_with_http_info(board_id, topic_id, **kwargs)  # noqa: E501
        else:
            (data) = self.update_topic_property_with_http_info(board_id, topic_id, **kwargs)  # noqa: E501
            return data

    def update_topic_property_with_http_info(self, board_id, topic_id, **kwargs):  # noqa: E501
        """Update Topic property  # 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_topic_property_with_http_info(board_id, topic_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str board_id: the **Board** identity (required)
        :param str topic_id: the **Topic** identity (required)
        :param PatchAction body: PATCH Action
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        return self.api_client.call_api(
            '/boards/{board_id}/topics/{topic_id}', 'PATCH',
            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)
