# coding: utf-8

"""
    Estuary API

    This is the API for the Estuary application.  # noqa: E501

    OpenAPI spec version: 0.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 estuary_client.api_client import ApiClient


class DealsApi(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 deal_estimate_post(self, body, **kwargs):  # noqa: E501
        """Estimate the cost of a deal  # noqa: E501

        This endpoint estimates the cost of a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_estimate_post(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MainEstimateDealBody body: The size of the deal in bytes, the replication factor, and the duration of the deal in blocks (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.deal_estimate_post_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.deal_estimate_post_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def deal_estimate_post_with_http_info(self, body, **kwargs):  # noqa: E501
        """Estimate the cost of a deal  # noqa: E501

        This endpoint estimates the cost of a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_estimate_post_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param MainEstimateDealBody body: The size of the deal in bytes, the replication factor, and the duration of the deal in blocks (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}

        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
            ['*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/deal/estimate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_info_dealid_get(self, dealid, **kwargs):  # noqa: E501
        """Get Deal Info  # noqa: E501

        This endpoint returns the deal info for a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_info_dealid_get(dealid, async_req=True)
        >>> result = thread.get()

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

    def deal_info_dealid_get_with_http_info(self, dealid, **kwargs):  # noqa: E501
        """Get Deal Info  # noqa: E501

        This endpoint returns the deal info for a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_info_dealid_get_with_http_info(dealid, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'dealid' in params:
            path_params['dealid'] = params['dealid']  # 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(
            '/deal/info/{dealid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_proposal_propcid_get(self, propcid, **kwargs):  # noqa: E501
        """Get Proposal  # noqa: E501

        This endpoint returns the proposal for a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_proposal_propcid_get(propcid, async_req=True)
        >>> result = thread.get()

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

    def deal_proposal_propcid_get_with_http_info(self, propcid, **kwargs):  # noqa: E501
        """Get Proposal  # noqa: E501

        This endpoint returns the proposal for a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_proposal_propcid_get_with_http_info(propcid, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'propcid' in params:
            path_params['propcid'] = params['propcid']  # 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(
            '/deal/proposal/{propcid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_query_miner_get(self, miner, **kwargs):  # noqa: E501
        """Query Ask  # noqa: E501

        This endpoint returns the ask for a given CID  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_query_miner_get(miner, async_req=True)
        >>> result = thread.get()

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

    def deal_query_miner_get_with_http_info(self, miner, **kwargs):  # noqa: E501
        """Query Ask  # noqa: E501

        This endpoint returns the ask for a given CID  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_query_miner_get_with_http_info(miner, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'miner' in params:
            path_params['miner'] = params['miner']  # 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(
            '/deal/query/{miner}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_status_by_proposal_propcid_get(self, propcid, **kwargs):  # noqa: E501
        """Get Deal Status by PropCid  # noqa: E501

        Get Deal Status by PropCid  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_status_by_proposal_propcid_get(propcid, async_req=True)
        >>> result = thread.get()

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

    def deal_status_by_proposal_propcid_get_with_http_info(self, propcid, **kwargs):  # noqa: E501
        """Get Deal Status by PropCid  # noqa: E501

        Get Deal Status by PropCid  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_status_by_proposal_propcid_get_with_http_info(propcid, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'propcid' in params:
            path_params['propcid'] = params['propcid']  # 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(
            '/deal/status-by-proposal/{propcid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_status_miner_propcid_get(self, miner, propcid, **kwargs):  # noqa: E501
        """Deal Status  # noqa: E501

        This endpoint returns the status of a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_status_miner_propcid_get(miner, propcid, async_req=True)
        >>> result = thread.get()

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

    def deal_status_miner_propcid_get_with_http_info(self, miner, propcid, **kwargs):  # noqa: E501
        """Deal Status  # noqa: E501

        This endpoint returns the status of a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_status_miner_propcid_get_with_http_info(miner, propcid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str miner: Miner (required)
        :param str propcid: Proposal CID (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'miner' in params:
            path_params['miner'] = params['miner']  # noqa: E501
        if 'propcid' in params:
            path_params['propcid'] = params['propcid']  # 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(
            '/deal/status/{miner}/{propcid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_transfer_in_progress_get(self, **kwargs):  # noqa: E501
        """Transfer In Progress  # noqa: E501

        This endpoint returns the in-progress transfers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_transfer_in_progress_get(async_req=True)
        >>> result = thread.get()

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

    def deal_transfer_in_progress_get_with_http_info(self, **kwargs):  # noqa: E501
        """Transfer In Progress  # noqa: E501

        This endpoint returns the in-progress transfers  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_transfer_in_progress_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: 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 deal_transfer_in_progress_get" % 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 = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/deal/transfer/in-progress', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deal_transfer_status_post(self, body, **kwargs):  # noqa: E501
        """Transfer Status  # noqa: E501

        This endpoint returns the status of a transfer  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_transfer_status_post(body, async_req=True)
        >>> result = thread.get()

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

    def deal_transfer_status_post_with_http_info(self, body, **kwargs):  # noqa: E501
        """Transfer Status  # noqa: E501

        This endpoint returns the status of a transfer  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deal_transfer_status_post_with_http_info(body, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}

        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
            ['*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/deal/transfer/status', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deals_failures_get(self, **kwargs):  # noqa: E501
        """Get storage failures for user  # noqa: E501

        This endpoint returns a list of storage failures for user  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deals_failures_get(async_req=True)
        >>> result = thread.get()

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

    def deals_failures_get_with_http_info(self, **kwargs):  # noqa: E501
        """Get storage failures for user  # noqa: E501

        This endpoint returns a list of storage failures for user  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deals_failures_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: 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 deals_failures_get" % 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 = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/deals/failures', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deals_make_miner_post(self, body, miner, **kwargs):  # noqa: E501
        """Make Deal  # noqa: E501

        This endpoint makes a deal for a given content and miner  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deals_make_miner_post(body, miner, async_req=True)
        >>> result = thread.get()

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

    def deals_make_miner_post_with_http_info(self, body, miner, **kwargs):  # noqa: E501
        """Make Deal  # noqa: E501

        This endpoint makes a deal for a given content and miner  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deals_make_miner_post_with_http_info(body, miner, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str body: Deal Request (required)
        :param str miner: Miner (required)
        :return: str
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'miner' in params:
            path_params['miner'] = params['miner']  # 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
            ['*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/deals/make/{miner}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 deals_status_deal_get(self, deal, **kwargs):  # noqa: E501
        """Get Deal Status  # noqa: E501

        This endpoint returns the status of a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deals_status_deal_get(deal, async_req=True)
        >>> result = thread.get()

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

    def deals_status_deal_get_with_http_info(self, deal, **kwargs):  # noqa: E501
        """Get Deal Status  # noqa: E501

        This endpoint returns the status of a deal  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deals_status_deal_get_with_http_info(deal, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'deal' in params:
            path_params['deal'] = params['deal']  # 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(
            '/deals/status/{deal}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 public_deals_failures_get(self, **kwargs):  # noqa: E501
        """Get storage failures  # noqa: E501

        This endpoint returns a list of storage failures  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.public_deals_failures_get(async_req=True)
        >>> result = thread.get()

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

    def public_deals_failures_get_with_http_info(self, **kwargs):  # noqa: E501
        """Get storage failures  # noqa: E501

        This endpoint returns a list of storage failures  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.public_deals_failures_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: 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 public_deals_failures_get" % 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 = ['bearerAuth']  # noqa: E501

        return self.api_client.call_api(
            '/public/deals/failures', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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 public_miners_storage_query_miner_get(self, miner, **kwargs):  # noqa: E501
        """Query Ask  # noqa: E501

        This endpoint returns the ask for a given CID  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.public_miners_storage_query_miner_get(miner, async_req=True)
        >>> result = thread.get()

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

    def public_miners_storage_query_miner_get_with_http_info(self, miner, **kwargs):  # noqa: E501
        """Query Ask  # noqa: E501

        This endpoint returns the ask for a given CID  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.public_miners_storage_query_miner_get_with_http_info(miner, async_req=True)
        >>> result = thread.get()

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

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

        collection_formats = {}

        path_params = {}
        if 'miner' in params:
            path_params['miner'] = params['miner']  # 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(
            '/public/miners/storage/query/{miner}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='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)
