# coding: utf-8

"""
    XMS API

    XMS is the controller of distributed storage system  # noqa: E501

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


class BlockVolumesApi(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 batch_get_block_volume_samples(self, **kwargs):  # noqa: E501
        """batch_get_block_volume_samples  # noqa: E501

        Get samples of multiple block volumes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.batch_get_block_volume_samples(async=True)
        >>> result = thread.get()

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

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

        Get samples of multiple block volumes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.batch_get_block_volume_samples_with_http_info(async=True)
        >>> result = thread.get()

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

        all_params = []  # noqa: E501
        all_params.append('async')
        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 batch_get_block_volume_samples" % 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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/samples', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MultiVolumesSamplesResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 create_block_volume(self, body, **kwargs):  # noqa: E501
        """create_block_volume  # noqa: E501

        Create block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_block_volume(body, async=True)
        >>> result = thread.get()

        :param async bool
        :param VolumeCreateReq body: volume info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.create_block_volume_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.create_block_volume_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def create_block_volume_with_http_info(self, body, **kwargs):  # noqa: E501
        """create_block_volume  # noqa: E501

        Create block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.create_block_volume_with_http_info(body, async=True)
        >>> result = thread.get()

        :param async bool
        :param VolumeCreateReq body: volume info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async')
        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_block_volume" % 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 `create_block_volume`")  # 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
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_block_volume(self, block_volume_id, **kwargs):  # noqa: E501
        """delete_block_volume  # noqa: E501

        Delete block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.delete_block_volume(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.delete_block_volume_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_block_volume_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def delete_block_volume_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """delete_block_volume  # noqa: E501

        Delete block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.delete_block_volume_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_block_volume(self, block_volume_id, **kwargs):  # noqa: E501
        """get_block_volume  # noqa: E501

        get a block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_block_volume(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_block_volume_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_block_volume_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def get_block_volume_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """get_block_volume  # noqa: E501

        get a block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_block_volume_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_block_volume_samples(self, block_volume_id, **kwargs):  # noqa: E501
        """get_block_volume_samples  # noqa: E501

        get a block volume's Samples  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_block_volume_samples(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :param str duration_begin: duration begin timestamp
        :param str duration_end: duration end timestamp
        :param str period: samples period
        :return: VolumeSamplesResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_block_volume_samples_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_block_volume_samples_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def get_block_volume_samples_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """get_block_volume_samples  # noqa: E501

        get a block volume's Samples  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_block_volume_samples_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :param str duration_begin: duration begin timestamp
        :param str duration_end: duration end timestamp
        :param str period: samples period
        :return: VolumeSamplesResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['block_volume_id', 'duration_begin', 'duration_end', 'period']  # noqa: E501
        all_params.append('async')
        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_block_volume_samples" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'block_volume_id' is set
        if ('block_volume_id' not in params or
                params['block_volume_id'] is None):
            raise ValueError("Missing the required parameter `block_volume_id` when calling `get_block_volume_samples`")  # noqa: E501

        collection_formats = {}

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

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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}/samples', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeSamplesResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_block_volumes(self, **kwargs):  # noqa: E501
        """list_block_volumes  # noqa: E501

        List block volumes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.list_block_volumes(async=True)
        >>> result = thread.get()

        :param async bool
        :param int limit: paging param
        :param int offset: paging param
        :param int pool_id: The id of the pool volumes belong to
        :param int block_snapshot_id: related snapshot id
        :param str name: name of volume
        :param int client_group_id: related client group id
        :param int mapping_group_id: related mapping group id
        :param int access_path_id: related access path id
        :param bool passive: passive or not
        :param str q: query param of search
        :param str sort: sort param of search
        :param bool all: show all volumes
        :return: VolumesResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.list_block_volumes_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_block_volumes_with_http_info(**kwargs)  # noqa: E501
            return data

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

        List block volumes  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.list_block_volumes_with_http_info(async=True)
        >>> result = thread.get()

        :param async bool
        :param int limit: paging param
        :param int offset: paging param
        :param int pool_id: The id of the pool volumes belong to
        :param int block_snapshot_id: related snapshot id
        :param str name: name of volume
        :param int client_group_id: related client group id
        :param int mapping_group_id: related mapping group id
        :param int access_path_id: related access path id
        :param bool passive: passive or not
        :param str q: query param of search
        :param str sort: sort param of search
        :param bool all: show all volumes
        :return: VolumesResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['limit', 'offset', 'pool_id', 'block_snapshot_id', 'name', 'client_group_id', 'mapping_group_id', 'access_path_id', 'passive', 'q', 'sort', 'all']  # noqa: E501
        all_params.append('async')
        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_block_volumes" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'limit' in params:
            query_params.append(('limit', params['limit']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('offset', params['offset']))  # noqa: E501
        if 'pool_id' in params:
            query_params.append(('pool_id', params['pool_id']))  # noqa: E501
        if 'block_snapshot_id' in params:
            query_params.append(('block_snapshot_id', params['block_snapshot_id']))  # noqa: E501
        if 'name' in params:
            query_params.append(('name', params['name']))  # noqa: E501
        if 'client_group_id' in params:
            query_params.append(('client_group_id', params['client_group_id']))  # noqa: E501
        if 'mapping_group_id' in params:
            query_params.append(('mapping_group_id', params['mapping_group_id']))  # noqa: E501
        if 'access_path_id' in params:
            query_params.append(('access_path_id', params['access_path_id']))  # noqa: E501
        if 'passive' in params:
            query_params.append(('passive', params['passive']))  # noqa: E501
        if 'q' in params:
            query_params.append(('q', params['q']))  # noqa: E501
        if 'sort' in params:
            query_params.append(('sort', params['sort']))  # noqa: E501
        if 'all' in params:
            query_params.append(('all', params['all']))  # 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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumesResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 migrate_block_volume(self, block_volume_id, body, **kwargs):  # noqa: E501
        """migrate_block_volume  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.migrate_block_volume(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeMigrateReq body: volume migration info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.migrate_block_volume_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.migrate_block_volume_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
            return data

    def migrate_block_volume_with_http_info(self, block_volume_id, body, **kwargs):  # noqa: E501
        """migrate_block_volume  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.migrate_block_volume_with_http_info(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeMigrateReq body: volume migration info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:migrate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 rebuild_block_volume_replication(self, block_volume_id, **kwargs):  # noqa: E501
        """rebuild_block_volume_replication  # noqa: E501

        Rebuild block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.rebuild_block_volume_replication(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :param bool force: force rebuild or not
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.rebuild_block_volume_replication_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.rebuild_block_volume_replication_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def rebuild_block_volume_replication_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """rebuild_block_volume_replication  # noqa: E501

        Rebuild block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.rebuild_block_volume_replication_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :param bool force: force rebuild or not
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

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

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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:rebuild-replication', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 set_block_volume_replication(self, block_volume_id, body, **kwargs):  # noqa: E501
        """set_block_volume_replication  # noqa: E501

        Set block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_block_volume_replication(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :param VolumeReplicationSetReq body: volume replication info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.set_block_volume_replication_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.set_block_volume_replication_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
            return data

    def set_block_volume_replication_with_http_info(self, block_volume_id, body, **kwargs):  # noqa: E501
        """set_block_volume_replication  # noqa: E501

        Set block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_block_volume_replication_with_http_info(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :param VolumeReplicationSetReq body: volume replication info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:set-replication', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 set_block_volume_replication_0(self, block_volume_id, **kwargs):  # noqa: E501
        """set_block_volume_replication_0  # noqa: E501

        Unset block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_block_volume_replication_0(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.set_block_volume_replication_0_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.set_block_volume_replication_0_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def set_block_volume_replication_0_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """set_block_volume_replication_0  # noqa: E501

        Unset block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_block_volume_replication_0_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:unset-replication', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 set_snapshot_protection(self, block_volume_id, body, **kwargs):  # noqa: E501
        """set_snapshot_protection  # noqa: E501

        Set snapshot protection for a block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_snapshot_protection(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeSnapshotProtectionReq body: request info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.set_snapshot_protection_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.set_snapshot_protection_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
            return data

    def set_snapshot_protection_with_http_info(self, block_volume_id, body, **kwargs):  # noqa: E501
        """set_snapshot_protection  # noqa: E501

        Set snapshot protection for a block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.set_snapshot_protection_with_http_info(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeSnapshotProtectionReq body: request info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:set-snapshot-protection', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 suspend_block_volume_replication(self, block_volume_id, **kwargs):  # noqa: E501
        """suspend_block_volume_replication  # noqa: E501

        Suspend block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.suspend_block_volume_replication(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.suspend_block_volume_replication_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.suspend_block_volume_replication_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def suspend_block_volume_replication_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """suspend_block_volume_replication  # noqa: E501

        Suspend block volume replication  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.suspend_block_volume_replication_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:suspend-replication', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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 unset_snapshot_protection(self, block_volume_id, **kwargs):  # noqa: E501
        """unset_snapshot_protection  # noqa: E501

        Unset snapshot protection for a block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.unset_snapshot_protection(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.unset_snapshot_protection_with_http_info(block_volume_id, **kwargs)  # noqa: E501
        else:
            (data) = self.unset_snapshot_protection_with_http_info(block_volume_id, **kwargs)  # noqa: E501
            return data

    def unset_snapshot_protection_with_http_info(self, block_volume_id, **kwargs):  # noqa: E501
        """unset_snapshot_protection  # noqa: E501

        Unset snapshot protection for a block volume  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.unset_snapshot_protection_with_http_info(block_volume_id, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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

        # 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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:unset-snapshot-protection', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_block_volume(self, block_volume_id, body, **kwargs):  # noqa: E501
        """update_block_volume  # noqa: E501

        Update block volume info  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_block_volume(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeUpdateReq body: volume info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.update_block_volume_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.update_block_volume_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
            return data

    def update_block_volume_with_http_info(self, block_volume_id, body, **kwargs):  # noqa: E501
        """update_block_volume  # noqa: E501

        Update block volume info  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_block_volume_with_http_info(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeUpdateReq body: volume info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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_migration(self, block_volume_id, body, **kwargs):  # noqa: E501
        """update_migration  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_migration(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeMigrateReq body: volume migration info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.update_migration_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
        else:
            (data) = self.update_migration_with_http_info(block_volume_id, body, **kwargs)  # noqa: E501
            return data

    def update_migration_with_http_info(self, block_volume_id, body, **kwargs):  # noqa: E501
        """update_migration  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.update_migration_with_http_info(block_volume_id, body, async=True)
        >>> result = thread.get()

        :param async bool
        :param int block_volume_id: the block volume id (required)
        :param VolumeMigrateReq body: volume migration info (required)
        :return: VolumeResp
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'block_volume_id' in params:
            path_params['block_volume_id'] = params['block_volume_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 = ['tokenInCookie', 'tokenInHeader', 'tokenInQuery']  # noqa: E501

        return self.api_client.call_api(
            '/block-volumes/{block_volume_id}:update-migration', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VolumeResp',  # noqa: E501
            auth_settings=auth_settings,
            async=params.get('async'),
            _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)
