# coding: utf-8

"""
    Cloudera Manager API

    <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>  # noqa: E501

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


class ParcelResourceApi(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 activate_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that activates the parcel on the cluster.  # noqa: E501

        A synchronous command that activates the parcel on the cluster. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.activate_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def activate_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that activates the parcel on the cluster.  # noqa: E501

        A synchronous command that activates the parcel on the cluster. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.activate_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/activate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 cancel_distribution_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that cancels the parcel distribution.  # noqa: E501

        A synchronous command that cancels the parcel distribution. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cancel_distribution_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def cancel_distribution_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that cancels the parcel distribution.  # noqa: E501

        A synchronous command that cancels the parcel distribution. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cancel_distribution_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/cancelDistribution', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 cancel_download_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that cancels the parcel download.  # noqa: E501

        A synchronous command that cancels the parcel download. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cancel_download_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def cancel_download_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that cancels the parcel download.  # noqa: E501

        A synchronous command that cancels the parcel download. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.cancel_download_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/cancelDownload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 deactivate_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that deactivates the parcel on the cluster.  # noqa: E501

        A synchronous command that deactivates the parcel on the cluster. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deactivate_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def deactivate_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that deactivates the parcel on the cluster.  # noqa: E501

        A synchronous command that deactivates the parcel on the cluster. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.deactivate_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/deactivate', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 read_parcel(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """Retrieves detailed information about a parcel.  # noqa: E501

        Retrieves detailed information about a parcel.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_parcel(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def read_parcel_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """Retrieves detailed information about a parcel.  # noqa: E501

        Retrieves detailed information about a parcel.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.read_parcel_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiParcel
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiParcel',  # 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 remove_download_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that removes the downloaded parcel.  # noqa: E501

        A synchronous command that removes the downloaded parcel. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.remove_download_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def remove_download_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that removes the downloaded parcel.  # noqa: E501

        A synchronous command that removes the downloaded parcel. <p> Since it is synchronous, the result is known immediately upon return.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.remove_download_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/removeDownload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 start_distribution_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that starts the distribution of the parcel to the cluster.  # noqa: E501

        A synchronous command that starts the distribution of the parcel to the cluster. <p> Since it is synchronous, the result is known immediately upon return. In order to see the progress of the distribution, a call to readParcel() needs to be made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_distribution_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def start_distribution_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that starts the distribution of the parcel to the cluster.  # noqa: E501

        A synchronous command that starts the distribution of the parcel to the cluster. <p> Since it is synchronous, the result is known immediately upon return. In order to see the progress of the distribution, a call to readParcel() needs to be made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_distribution_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/startDistribution', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 start_download_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that starts the parcel download.  # noqa: E501

        A synchronous command that starts the parcel download. <p> Since it is synchronous, the result is known immediately upon return. In order to see the progress of the download, a call to readParcel() needs to be made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_download_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def start_download_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that starts the parcel download.  # noqa: E501

        A synchronous command that starts the parcel download. <p> Since it is synchronous, the result is known immediately upon return. In order to see the progress of the download, a call to readParcel() needs to be made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_download_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/startDownload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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 start_removal_of_distribution_command(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that removes the distribution from the hosts in the cluster.  # noqa: E501

        A synchronous command that removes the distribution from the hosts in the cluster. <p> Since it is synchronous, the result is known immediately upon return. In order to see the progress of the removal, a call to readParcel() needs to be made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_removal_of_distribution_command(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

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

    def start_removal_of_distribution_command_with_http_info(self, cluster_name, product, version, **kwargs):  # noqa: E501
        """A synchronous command that removes the distribution from the hosts in the cluster.  # noqa: E501

        A synchronous command that removes the distribution from the hosts in the cluster. <p> Since it is synchronous, the result is known immediately upon return. In order to see the progress of the removal, a call to readParcel() needs to be made.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_removal_of_distribution_command_with_http_info(cluster_name, product, version, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str cluster_name: (required)
        :param str product: the product (required)
        :param str version: the version (required)
        :return: ApiCommand
                 If the method is called asynchronously,
                 returns the request thread.
        """

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

        collection_formats = {}

        path_params = {}
        if 'cluster_name' in params:
            path_params['clusterName'] = params['cluster_name']  # noqa: E501
        if 'product' in params:
            path_params['product'] = params['product']  # noqa: E501
        if 'version' in params:
            path_params['version'] = params['version']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/startRemovalOfDistribution', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ApiCommand',  # 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)
