# coding: utf-8

"""
    Cyclos 4.11.5 API

    The REST API for Cyclos 4.11.5  # noqa: E501

    OpenAPI spec version: 4.11.5
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from swagger_client.api_client import ApiClient


class OperationsApi(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 get_ad_operation_data_for_run(self, ad, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over an advertisement   # noqa: E501

        Returns data to run a specific custom operation over an advertisement. The operation scope must be `advertisement`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ad_operation_data_for_run(ad, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_ad_operation_data_for_run_with_http_info(ad, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_ad_operation_data_for_run_with_http_info(ad, operation, **kwargs)  # noqa: E501
            return data

    def get_ad_operation_data_for_run_with_http_info(self, ad, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over an advertisement   # noqa: E501

        Returns data to run a specific custom operation over an advertisement. The operation scope must be `advertisement`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_ad_operation_data_for_run_with_http_info(ad, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['ad', 'operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_ad_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'ad' is set
        if self.api_client.client_side_validation and ('ad' not in params or
                                                       params['ad'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `ad` when calling `get_ad_operation_data_for_run`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_ad_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/marketplace/{ad}/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_contact_info_operation_data_for_run(self, id, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over an additional contact information   # noqa: E501

        Returns data to run a specific custom operation over an additional contact information. The operation scope must be `contactInfo`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_contact_info_operation_data_for_run(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_contact_info_operation_data_for_run_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_contact_info_operation_data_for_run_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def get_contact_info_operation_data_for_run_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over an additional contact information   # noqa: E501

        Returns data to run a specific custom operation over an additional contact information. The operation scope must be `contactInfo`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_contact_info_operation_data_for_run_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_contact_info_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `get_contact_info_operation_data_for_run`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_contact_info_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-infos/{id}/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_contact_operation_data_for_run(self, id, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over a contact   # noqa: E501

        Returns data to run a specific custom operation over a contact. The operation scope must be `contact`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_contact_operation_data_for_run(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_contact_operation_data_for_run_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_contact_operation_data_for_run_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def get_contact_operation_data_for_run_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over a contact   # noqa: E501

        Returns data to run a specific custom operation over a contact. The operation scope must be `contact`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_contact_operation_data_for_run_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_contact_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `get_contact_operation_data_for_run`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_contact_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-list/{id}/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_operation_data_for_run(self, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation without additional scope   # noqa: E501

        Returns data to run a specific custom operation, which must not have any additional scope to run, such as user, contact, record or advertisement. Hence, this path is suitable for custom operations with scope `system` or `internal`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_operation_data_for_run(operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_operation_data_for_run_with_http_info(operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_operation_data_for_run_with_http_info(operation, **kwargs)  # noqa: E501
            return data

    def get_operation_data_for_run_with_http_info(self, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation without additional scope   # noqa: E501

        Returns data to run a specific custom operation, which must not have any additional scope to run, such as user, contact, record or advertisement. Hence, this path is suitable for custom operations with scope `system` or `internal`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_operation_data_for_run_with_http_info(operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_owner_operation_data_for_run(self, owner, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over an owner   # noqa: E501

        Returns data to run a specific custom operation over a given user or system if the `system` owner is used. The operation scope must match, being either `system` or `user`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_owner_operation_data_for_run(owner, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_owner_operation_data_for_run_with_http_info(owner, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_owner_operation_data_for_run_with_http_info(owner, operation, **kwargs)  # noqa: E501
            return data

    def get_owner_operation_data_for_run_with_http_info(self, owner, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over an owner   # noqa: E501

        Returns data to run a specific custom operation over a given user or system if the `system` owner is used. The operation scope must match, being either `system` or `user`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_owner_operation_data_for_run_with_http_info(owner, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['owner', 'operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_owner_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'owner' is set
        if self.api_client.client_side_validation and ('owner' not in params or
                                                       params['owner'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `owner` when calling `get_owner_operation_data_for_run`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_owner_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/{owner}/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_record_operation_data_for_run(self, id, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over a record   # noqa: E501

        Returns data to run a specific custom operation over a record. The operation scope must be `record`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_record_operation_data_for_run(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_record_operation_data_for_run_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_record_operation_data_for_run_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def get_record_operation_data_for_run_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over a record   # noqa: E501

        Returns data to run a specific custom operation over a record. The operation scope must be `record`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_record_operation_data_for_run_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_record_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `get_record_operation_data_for_run`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_record_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/records/{id}/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_transfer_operation_data_for_run(self, key, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over a transfer   # noqa: E501

        Returns data to run a specific custom operation over a transfer. The operation scope must be `transfer`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_transfer_operation_data_for_run(key, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_transfer_operation_data_for_run_with_http_info(key, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.get_transfer_operation_data_for_run_with_http_info(key, operation, **kwargs)  # noqa: E501
            return data

    def get_transfer_operation_data_for_run_with_http_info(self, key, operation, **kwargs):  # noqa: E501
        """Returns configuration data for running a custom operation over a transfer   # noqa: E501

        Returns data to run a specific custom operation over a transfer. The operation scope must be `transfer`.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_transfer_operation_data_for_run_with_http_info(key, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: OperationDataForRun
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['key', 'operation', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_transfer_operation_data_for_run" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in params or
                                                       params['key'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `key` when calling `get_transfer_operation_data_for_run`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `get_transfer_operation_data_for_run`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/transfer/{key}/operations/{operation}/data-for-run', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OperationDataForRun',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_operations_by_ad(self, ad, **kwargs):  # noqa: E501
        """Lists the custom operations over the given advertisement  # noqa: E501

        Returns the custom operations the authenticated user can run over the given advertisement. All returned operations have the scope `advertisement`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_ad(ad, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_operations_by_ad_with_http_info(ad, **kwargs)  # noqa: E501
        else:
            (data) = self.list_operations_by_ad_with_http_info(ad, **kwargs)  # noqa: E501
            return data

    def list_operations_by_ad_with_http_info(self, ad, **kwargs):  # noqa: E501
        """Lists the custom operations over the given advertisement  # noqa: E501

        Returns the custom operations the authenticated user can run over the given advertisement. All returned operations have the scope `advertisement`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_ad_with_http_info(ad, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['ad', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_operations_by_ad" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'ad' is set
        if self.api_client.client_side_validation and ('ad' not in params or
                                                       params['ad'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `ad` when calling `list_operations_by_ad`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/marketplace/{ad}/operations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Operation]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_operations_by_contact(self, id, **kwargs):  # noqa: E501
        """Lists the custom operations over the given contact  # noqa: E501

        Returns the custom operations the authenticated user can run over the given contact. All returned operations have the scope `contact`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_contact(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_operations_by_contact_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_operations_by_contact_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def list_operations_by_contact_with_http_info(self, id, **kwargs):  # noqa: E501
        """Lists the custom operations over the given contact  # noqa: E501

        Returns the custom operations the authenticated user can run over the given contact. All returned operations have the scope `contact`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_contact_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_operations_by_contact" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `list_operations_by_contact`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-list/{id}/operations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Operation]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_operations_by_contact_info(self, id, **kwargs):  # noqa: E501
        """Lists the custom operations over the given additional contact information   # noqa: E501

        Returns the custom operations the authenticated user can run over the given additional contact iformation. All returned operations have the scope `contactInfo`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_contact_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_operations_by_contact_info_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_operations_by_contact_info_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def list_operations_by_contact_info_with_http_info(self, id, **kwargs):  # noqa: E501
        """Lists the custom operations over the given additional contact information   # noqa: E501

        Returns the custom operations the authenticated user can run over the given additional contact iformation. All returned operations have the scope `contactInfo`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_contact_info_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_operations_by_contact_info" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `list_operations_by_contact_info`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-infos/{id}/operations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Operation]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_operations_by_owner(self, owner, **kwargs):  # noqa: E501
        """Lists the custom operations over the system or user  # noqa: E501

        Returns the custom operations the authenticated user can run over the given user or system if the `system` owner is used.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_owner(owner, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_operations_by_owner_with_http_info(owner, **kwargs)  # noqa: E501
        else:
            (data) = self.list_operations_by_owner_with_http_info(owner, **kwargs)  # noqa: E501
            return data

    def list_operations_by_owner_with_http_info(self, owner, **kwargs):  # noqa: E501
        """Lists the custom operations over the system or user  # noqa: E501

        Returns the custom operations the authenticated user can run over the given user or system if the `system` owner is used.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_owner_with_http_info(owner, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['owner', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_operations_by_owner" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'owner' is set
        if self.api_client.client_side_validation and ('owner' not in params or
                                                       params['owner'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `owner` when calling `list_operations_by_owner`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/{owner}/operations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Operation]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_operations_by_record(self, id, **kwargs):  # noqa: E501
        """Lists the custom operations over the given record  # noqa: E501

        Returns the custom operations the authenticated user can run over the given record. All returned operations have the scope `record`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_record(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_operations_by_record_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.list_operations_by_record_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def list_operations_by_record_with_http_info(self, id, **kwargs):  # noqa: E501
        """Lists the custom operations over the given record  # noqa: E501

        Returns the custom operations the authenticated user can run over the given record. All returned operations have the scope `record`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_record_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_operations_by_record" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `list_operations_by_record`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/records/{id}/operations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Operation]',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def list_operations_by_transfer(self, key, **kwargs):  # noqa: E501
        """Lists the custom operations over the given transfer  # noqa: E501

        Returns the custom operations the authenticated user can run over the given transfer. All returned operations have the scope `transfer`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_transfer(key, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_operations_by_transfer_with_http_info(key, **kwargs)  # noqa: E501
        else:
            (data) = self.list_operations_by_transfer_with_http_info(key, **kwargs)  # noqa: E501
            return data

    def list_operations_by_transfer_with_http_info(self, key, **kwargs):  # noqa: E501
        """Lists the custom operations over the given transfer  # noqa: E501

        Returns the custom operations the authenticated user can run over the given transfer. All returned operations have the scope `transfer`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_operations_by_transfer_with_http_info(key, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :return: list[Operation]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['key', 'fields']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method list_operations_by_transfer" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in params or
                                                       params['key'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `key` when calling `list_operations_by_transfer`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/transfers/{key}/operations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='list[Operation]',  # 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 run_ad_operation(self, ad, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an advertisement  # noqa: E501

        Runs a specific custom operation over a given advertisement. The operation scope must be `advertisement`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_ad_operation(ad, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_ad_operation_with_http_info(ad, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_ad_operation_with_http_info(ad, operation, **kwargs)  # noqa: E501
            return data

    def run_ad_operation_with_http_info(self, ad, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an advertisement  # noqa: E501

        Runs a specific custom operation over a given advertisement. The operation scope must be `advertisement`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_ad_operation_with_http_info(ad, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['ad', 'operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_ad_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'ad' is set
        if self.api_client.client_side_validation and ('ad' not in params or
                                                       params['ad'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `ad` when calling `run_ad_operation`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_ad_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/marketplace/{ad}/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_ad_operation_with_upload(self, ad, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an advertisement while uploading a file   # noqa: E501

        Runs a specific custom operation over a given advertisement. The operation scope must be `advertisement`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_ad_operation_with_upload(ad, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_ad_operation_with_upload_with_http_info(ad, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_ad_operation_with_upload_with_http_info(ad, operation, **kwargs)  # noqa: E501
            return data

    def run_ad_operation_with_upload_with_http_info(self, ad, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an advertisement while uploading a file   # noqa: E501

        Runs a specific custom operation over a given advertisement. The operation scope must be `advertisement`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_ad_operation_with_upload_with_http_info(ad, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str ad: Can be either the advertisement internal identifier or, in case of webshop advertisements, can be the product number (if the owner is the logged user) or a string in the form `productNumber@user`, with the user identifier as well.       (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['ad', 'operation', 'fields', 'params', 'file']  # 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 run_ad_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'ad' is set
        if self.api_client.client_side_validation and ('ad' not in params or
                                                       params['ad'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `ad` when calling `run_ad_operation_with_upload`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_ad_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/marketplace/{ad}/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_contact_info_operation(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an additional contact information   # noqa: E501

        Runs a specific custom operation over a given additional contact information. The operation scope must be `contactInfo`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_info_operation(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_contact_info_operation_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_contact_info_operation_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def run_contact_info_operation_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an additional contact information   # noqa: E501

        Runs a specific custom operation over a given additional contact information. The operation scope must be `contactInfo`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_info_operation_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_contact_info_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_contact_info_operation`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_contact_info_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-infos/{id}/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_contact_info_operation_with_upload(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an additional contact information while uploading a file   # noqa: E501

        Runs a specific custom operation over a given additional contact information. The operation scope must be `contactInfo`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_info_operation_with_upload(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_contact_info_operation_with_upload_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_contact_info_operation_with_upload_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def run_contact_info_operation_with_upload_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an additional contact information while uploading a file   # noqa: E501

        Runs a specific custom operation over a given additional contact information. The operation scope must be `contactInfo`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_info_operation_with_upload_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields', 'params', 'file']  # 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 run_contact_info_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_contact_info_operation_with_upload`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_contact_info_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-infos/{id}/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_contact_operation(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a contact  # noqa: E501

        Runs a specific custom operation over a given contact. The operation scope must be `contact`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_operation(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_contact_operation_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_contact_operation_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def run_contact_operation_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a contact  # noqa: E501

        Runs a specific custom operation over a given contact. The operation scope must be `contact`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_operation_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_contact_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_contact_operation`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_contact_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-list/{id}/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_contact_operation_with_upload(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an contact while uploading a file   # noqa: E501

        Runs a specific custom operation over a given contact. The operation scope must be `contact`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_operation_with_upload(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_contact_operation_with_upload_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_contact_operation_with_upload_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def run_contact_operation_with_upload_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over an contact while uploading a file   # noqa: E501

        Runs a specific custom operation over a given contact. The operation scope must be `contact`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_contact_operation_with_upload_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields', 'params', 'file']  # 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 run_contact_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_contact_operation_with_upload`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_contact_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/contact-list/{id}/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_custom_operation_callback(self, id, **kwargs):  # noqa: E501
        """Runs the callback of an external redirect custom operation   # noqa: E501

        Custom operations may be configured in Cyclos to be of result type `externalRedirect`. In such case, the regular execution returns an URL to which redirect clients. Once the external page processing is complete, the user is redirected back, so the operation can be completed. This operation should be executed to complete the payment. In order for the external service receive the correct URL, Cyclos need to have a link generation script that handles the link type `EXTERNAL_REDIRECT`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_custom_operation_callback(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The external redirect identifier. Received as part of the URL which is generated by Cyclos to the external service to use as callback.  (required)
        :param str token: The security token which is received as part of the URL which is generated by Cyclos to the external service to use as callback. 
        :param HttpRequestData callback_request: Data of the original callback request sent by the external service 
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_custom_operation_callback_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.run_custom_operation_callback_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def run_custom_operation_callback_with_http_info(self, id, **kwargs):  # noqa: E501
        """Runs the callback of an external redirect custom operation   # noqa: E501

        Custom operations may be configured in Cyclos to be of result type `externalRedirect`. In such case, the regular execution returns an URL to which redirect clients. Once the external page processing is complete, the user is redirected back, so the operation can be completed. This operation should be executed to complete the payment. In order for the external service receive the correct URL, Cyclos need to have a link generation script that handles the link type `EXTERNAL_REDIRECT`.   # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_custom_operation_callback_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The external redirect identifier. Received as part of the URL which is generated by Cyclos to the external service to use as callback.  (required)
        :param str token: The security token which is received as part of the URL which is generated by Cyclos to the external service to use as callback. 
        :param HttpRequestData callback_request: Data of the original callback request sent by the external service 
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'token', 'callback_request']  # 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 run_custom_operation_callback" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_custom_operation_callback`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'token' in params:
            query_params.append(('token', params['token']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'callback_request' in params:
            body_params = params['callback_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/operations/callback/{id}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_operation(self, operation, **kwargs):  # noqa: E501
        """Runs a custom operation without additional scope  # noqa: E501

        Runs a specific custom operation without additional scope. Is suitable for operations with scope `system` or `internal`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_operation(operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_operation_with_http_info(operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_operation_with_http_info(operation, **kwargs)  # noqa: E501
            return data

    def run_operation_with_http_info(self, operation, **kwargs):  # noqa: E501
        """Runs a custom operation without additional scope  # noqa: E501

        Runs a specific custom operation without additional scope. Is suitable for operations with scope `system` or `internal`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_operation_with_http_info(operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_operation_with_upload(self, operation, **kwargs):  # noqa: E501
        """Runs a custom operation without additional scope while uploading a file   # noqa: E501

        Runs a specific custom operation without additional scope. Is suitable for operations with scope `system` or `internal`.  This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_operation_with_upload(operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_operation_with_upload_with_http_info(operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_operation_with_upload_with_http_info(operation, **kwargs)  # noqa: E501
            return data

    def run_operation_with_upload_with_http_info(self, operation, **kwargs):  # noqa: E501
        """Runs a custom operation without additional scope while uploading a file   # noqa: E501

        Runs a specific custom operation without additional scope. Is suitable for operations with scope `system` or `internal`.  This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_operation_with_upload_with_http_info(operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['operation', 'fields', 'params', 'file']  # 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 run_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_owner_operation(self, owner, operation, **kwargs):  # noqa: E501
        """Runs a custom operation either for system or user  # noqa: E501

        Runs a specific custom operation over a given user or system if the `system` owner is used. The operation scope must match, being either `system` or `user`.  If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_owner_operation(owner, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_owner_operation_with_http_info(owner, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_owner_operation_with_http_info(owner, operation, **kwargs)  # noqa: E501
            return data

    def run_owner_operation_with_http_info(self, owner, operation, **kwargs):  # noqa: E501
        """Runs a custom operation either for system or user  # noqa: E501

        Runs a specific custom operation over a given user or system if the `system` owner is used. The operation scope must match, being either `system` or `user`.  If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_owner_operation_with_http_info(owner, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['owner', 'operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_owner_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'owner' is set
        if self.api_client.client_side_validation and ('owner' not in params or
                                                       params['owner'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `owner` when calling `run_owner_operation`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_owner_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/{owner}/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_owner_operation_with_upload(self, owner, operation, **kwargs):  # noqa: E501
        """Runs a custom operation either for system or user while uploading a file   # noqa: E501

        Runs a specific custom operation over a given user or system if the `system` owner is used. The operation scope must match, being either `system` or `user`.  This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_owner_operation_with_upload(owner, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_owner_operation_with_upload_with_http_info(owner, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_owner_operation_with_upload_with_http_info(owner, operation, **kwargs)  # noqa: E501
            return data

    def run_owner_operation_with_upload_with_http_info(self, owner, operation, **kwargs):  # noqa: E501
        """Runs a custom operation either for system or user while uploading a file   # noqa: E501

        Runs a specific custom operation over a given user or system if the `system` owner is used. The operation scope must match, being either `system` or `user`.  This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_owner_operation_with_upload_with_http_info(owner, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str owner: Can be one of: * a user identification value, such as id, username, e-mail, phone, etc.   Id is always allowed, others depend on Cyclos configuration. Note that   a valid numeric value is always considered as id. For example, when   using another identification method that can be numeric only, prefix   the value with a single quote (like in Excel spreadsheets), for   example, `'1234567890`;     * `self` for the currently authenticated user; * `system` for data that belongs to the system.  (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['owner', 'operation', 'fields', 'params', 'file']  # 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 run_owner_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'owner' is set
        if self.api_client.client_side_validation and ('owner' not in params or
                                                       params['owner'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `owner` when calling `run_owner_operation_with_upload`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_owner_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/{owner}/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_record_operation(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a record  # noqa: E501

        Runs a specific custom operation over a given record. The operation scope must be `record`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_record_operation(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_record_operation_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_record_operation_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def run_record_operation_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a record  # noqa: E501

        Runs a specific custom operation over a given record. The operation scope must be `record`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_record_operation_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_record_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_record_operation`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_record_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/records/{id}/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_record_operation_with_upload(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a record while uploading a file   # noqa: E501

        Runs a specific custom operation over a given record. The operation scope must be `record`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_record_operation_with_upload(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_record_operation_with_upload_with_http_info(id, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_record_operation_with_upload_with_http_info(id, operation, **kwargs)  # noqa: E501
            return data

    def run_record_operation_with_upload_with_http_info(self, id, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a record while uploading a file   # noqa: E501

        Runs a specific custom operation over a given record. The operation scope must be `record`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_record_operation_with_upload_with_http_info(id, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str id: The object identification (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'operation', 'fields', 'params', 'file']  # 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 run_record_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and ('id' not in params or
                                                       params['id'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `id` when calling `run_record_operation_with_upload`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_record_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/records/{id}/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_transfer_operation(self, key, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a transfer  # noqa: E501

        Runs a specific custom operation over a given transfer. The operation scope must be `transfer`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_transfer_operation(key, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_transfer_operation_with_http_info(key, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_transfer_operation_with_http_info(key, operation, **kwargs)  # noqa: E501
            return data

    def run_transfer_operation_with_http_info(self, key, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a transfer  # noqa: E501

        Runs a specific custom operation over a given transfer. The operation scope must be `transfer`. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_transfer_operation_with_http_info(key, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param RunOperation params: The custom operation parameters
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['key', 'operation', 'fields', 'params']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method run_transfer_operation" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in params or
                                                       params['key'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `key` when calling `run_transfer_operation`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_transfer_operation`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'params' in params:
            body_params = params['params']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/transfers/{key}/operations/{operation}/run', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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 run_transfer_operation_with_upload(self, key, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a transfer while uploading a file   # noqa: E501

        Runs a specific custom operation over a given transfer. The operation scope must be `transfer`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_transfer_operation_with_upload(key, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.run_transfer_operation_with_upload_with_http_info(key, operation, **kwargs)  # noqa: E501
        else:
            (data) = self.run_transfer_operation_with_upload_with_http_info(key, operation, **kwargs)  # noqa: E501
            return data

    def run_transfer_operation_with_upload_with_http_info(self, key, operation, **kwargs):  # noqa: E501
        """Runs a custom operation over a transfer while uploading a file   # noqa: E501

        Runs a specific custom operation over a given transfer. The operation scope must be `transfer`. This path allows uploading a file, by using a `multipart-form-data` post. If the operation resulted in a file download (either because the `resultType` is `fileDownload` or is a `resultPage` running for either PDF or CSV) the resulting contente type will be of the file itself. Otherwise will result in an `application/json` with the result object.    # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.run_transfer_operation_with_upload_with_http_info(key, operation, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str key: Either the id or transaction number (required)
        :param str operation: Either the id or internal name of the custom operation (required)
        :param list[str] fields: Select which fields to include on returned data. If nothing is set, all object fields are returned. Unprefixed field names will be handled like a whitelist (only listed fields will be included), while names starting with a minus (-) or exclamation mark (!) will be handled as blacklist (listed fields will not be included). This works for nesting as well. For example: `a,b.b1,c.-c1,c.-c2` will return the fields `a`, `b` (containing only the `b1` field) and `c` (containing all its fields except for `c1` or `c2`).  
        :param str params: The custom operation parameters, encoded as `RunOperation`.  
        :param file file: The file being uploaded
        :return: RunOperationResult
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['key', 'operation', 'fields', 'params', 'file']  # 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 run_transfer_operation_with_upload" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'key' is set
        if self.api_client.client_side_validation and ('key' not in params or
                                                       params['key'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `key` when calling `run_transfer_operation_with_upload`")  # noqa: E501
        # verify the required parameter 'operation' is set
        if self.api_client.client_side_validation and ('operation' not in params or
                                                       params['operation'] is None):  # noqa: E501
            raise ValueError("Missing the required parameter `operation` when calling `run_transfer_operation_with_upload`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'fields' in params:
            query_params.append(('fields', params['fields']))  # noqa: E501
            collection_formats['fields'] = 'multi'  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}
        if 'params' in params:
            form_params.append(('params', params['params']))  # noqa: E501
        if 'file' in params:
            local_var_files['file'] = params['file']  # noqa: E501

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', 'text/plain', 'text/html', 'text/css', 'text/yaml', 'text/javascript', 'text/csv', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/zip', 'image/svg+xml', 'application/octet-stream'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['multipart/form-data'])  # noqa: E501

        # Authentication setting
        auth_settings = ['accessClient', 'basic', 'session']  # noqa: E501

        return self.api_client.call_api(
            '/transfers/{key}/operations/{operation}/run-upload', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='RunOperationResult',  # 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)
