# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all clients.  # noqa: E501

    OpenAPI spec version: 1.96
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from onshape_client.api_client import ApiClient


class AppElementsApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def commit_transaction(self, did, eid, wid, tid, bt_app_element_commit_transaction_params, **kwargs):  # noqa: E501
        """Commit Transaction  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.commit_transaction(did, eid, wid, tid, bt_app_element_commit_transaction_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wid: (required)
        :param str tid: (required)
        :param BTAppElementCommitTransactionParams bt_app_element_commit_transaction_params: (required)
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.commit_transaction_with_http_info(did, eid, wid, tid, bt_app_element_commit_transaction_params, **kwargs)  # noqa: E501
        else:
            (data) = self.commit_transaction_with_http_info(did, eid, wid, tid, bt_app_element_commit_transaction_params, **kwargs)  # noqa: E501
            return data

    def commit_transaction_with_http_info(self, did, eid, wid, tid, bt_app_element_commit_transaction_params, **kwargs):  # noqa: E501
        """Commit Transaction  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.commit_transaction_with_http_info(did, eid, wid, tid, bt_app_element_commit_transaction_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wid: (required)
        :param str tid: (required)
        :param BTAppElementCommitTransactionParams bt_app_element_commit_transaction_params: (required)
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wid', 'tid', 'bt_app_element_commit_transaction_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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method commit_transaction" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `commit_transaction`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `commit_transaction`")  # noqa: E501
        # verify the required parameter 'wid' is set
        if ('wid' not in local_var_params or
                local_var_params['wid'] is None):
            raise ValueError("Missing the required parameter `wid` when calling `commit_transaction`")  # noqa: E501
        # verify the required parameter 'tid' is set
        if ('tid' not in local_var_params or
                local_var_params['tid'] is None):
            raise ValueError("Missing the required parameter `tid` when calling `commit_transaction`")  # noqa: E501
        # verify the required parameter 'bt_app_element_commit_transaction_params' is set
        if ('bt_app_element_commit_transaction_params' not in local_var_params or
                local_var_params['bt_app_element_commit_transaction_params'] is None):
            raise ValueError("Missing the required parameter `bt_app_element_commit_transaction_params` when calling `commit_transaction`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wid' in local_var_params:
            path_params['wid'] = local_var_params['wid']  # noqa: E501
        if 'tid' in local_var_params:
            path_params['tid'] = local_var_params['tid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json;charset=UTF-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/w/{wid}/e/{eid}/transactions/{tid}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementModifyInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create7(self, did, wid, bt_app_element_params, **kwargs):  # noqa: E501
        """Create Element.  # noqa: E501

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

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

    def create7_with_http_info(self, did, wid, bt_app_element_params, **kwargs):  # noqa: E501
        """Create Element.  # noqa: E501

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

        :param async_req bool
        :param str did: (required)
        :param str wid: (required)
        :param BTAppElementParams bt_app_element_params: (required)
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'wid', 'bt_app_element_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')

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

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'wid' in local_var_params:
            path_params['wid'] = local_var_params['wid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json;charset=UTF-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/w/{wid}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementModifyInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def create_reference1(self, did, eid, wvm, wvmid, bt_app_element_reference_params, **kwargs):  # noqa: E501
        """Create Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_reference1(did, eid, wvm, wvmid, bt_app_element_reference_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param BTAppElementReferenceParams bt_app_element_reference_params: (required)
        :return: BTAppElementReferenceInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_reference1_with_http_info(did, eid, wvm, wvmid, bt_app_element_reference_params, **kwargs)  # noqa: E501
        else:
            (data) = self.create_reference1_with_http_info(did, eid, wvm, wvmid, bt_app_element_reference_params, **kwargs)  # noqa: E501
            return data

    def create_reference1_with_http_info(self, did, eid, wvm, wvmid, bt_app_element_reference_params, **kwargs):  # noqa: E501
        """Create Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_reference1_with_http_info(did, eid, wvm, wvmid, bt_app_element_reference_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param BTAppElementReferenceParams bt_app_element_reference_params: (required)
        :return: BTAppElementReferenceInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'bt_app_element_reference_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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_reference1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `create_reference1`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `create_reference1`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `create_reference1`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `create_reference1`")  # noqa: E501
        # verify the required parameter 'bt_app_element_reference_params' is set
        if ('bt_app_element_reference_params' not in local_var_params or
                local_var_params['bt_app_element_reference_params'] is None):
            raise ValueError("Missing the required parameter `bt_app_element_reference_params` when calling `create_reference1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json;charset=UTF-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/references', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementReferenceInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_content1(self, did, eid, wvm, wvmid, sid, **kwargs):  # noqa: E501
        """Delete a Sub-element  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_content1(did, eid, wvm, wvmid, sid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str sid: (required)
        :param str transaction_id:
        :param str parent_change_id:
        :param str description:
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_content1_with_http_info(did, eid, wvm, wvmid, sid, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_content1_with_http_info(did, eid, wvm, wvmid, sid, **kwargs)  # noqa: E501
            return data

    def delete_content1_with_http_info(self, did, eid, wvm, wvmid, sid, **kwargs):  # noqa: E501
        """Delete a Sub-element  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_content1_with_http_info(did, eid, wvm, wvmid, sid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str sid: (required)
        :param str transaction_id:
        :param str parent_change_id:
        :param str description:
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'sid', 'transaction_id', 'parent_change_id', 'description']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_content1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `delete_content1`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `delete_content1`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `delete_content1`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `delete_content1`")  # noqa: E501
        # verify the required parameter 'sid' is set
        if ('sid' not in local_var_params or
                local_var_params['sid'] is None):
            raise ValueError("Missing the required parameter `sid` when calling `delete_content1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'sid' in local_var_params:
            path_params['sid'] = local_var_params['sid']  # noqa: E501

        query_params = []
        if 'transaction_id' in local_var_params:
            query_params.append(('transactionId', local_var_params['transaction_id']))  # noqa: E501
        if 'parent_change_id' in local_var_params:
            query_params.append(('parentChangeId', local_var_params['parent_change_id']))  # noqa: E501
        if 'description' in local_var_params:
            query_params.append(('description', local_var_params['description']))  # 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 = ['OAuth2']  # noqa: E501

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/content/subelements/{sid}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementModifyInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_reference1(self, did, eid, wvm, wvmid, rid, **kwargs):  # noqa: E501
        """Delete Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_reference1(did, eid, wvm, wvmid, rid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str rid: (required)
        :param str transaction_id:
        :param str parent_change_id:
        :param str description:
        :return: BTAppElementReferenceInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_reference1_with_http_info(did, eid, wvm, wvmid, rid, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_reference1_with_http_info(did, eid, wvm, wvmid, rid, **kwargs)  # noqa: E501
            return data

    def delete_reference1_with_http_info(self, did, eid, wvm, wvmid, rid, **kwargs):  # noqa: E501
        """Delete Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_reference1_with_http_info(did, eid, wvm, wvmid, rid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str rid: (required)
        :param str transaction_id:
        :param str parent_change_id:
        :param str description:
        :return: BTAppElementReferenceInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'rid', 'transaction_id', 'parent_change_id', 'description']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_reference1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `delete_reference1`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `delete_reference1`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `delete_reference1`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `delete_reference1`")  # noqa: E501
        # verify the required parameter 'rid' is set
        if ('rid' not in local_var_params or
                local_var_params['rid'] is None):
            raise ValueError("Missing the required parameter `rid` when calling `delete_reference1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'rid' in local_var_params:
            path_params['rid'] = local_var_params['rid']  # noqa: E501

        query_params = []
        if 'transaction_id' in local_var_params:
            query_params.append(('transactionId', local_var_params['transaction_id']))  # noqa: E501
        if 'parent_change_id' in local_var_params:
            query_params.append(('parentChangeId', local_var_params['parent_change_id']))  # noqa: E501
        if 'description' in local_var_params:
            query_params.append(('description', local_var_params['description']))  # 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 = ['OAuth2']  # noqa: E501

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/references/{rid}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementReferenceInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_history(self, did, eid, wvm, wvmid, **kwargs):  # noqa: E501
        """Get History  # 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_history(did, eid, wvm, wvmid, async_req=True)
        >>> result = thread.get()

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

    def get_history_with_http_info(self, did, eid, wvm, wvmid, **kwargs):  # noqa: E501
        """Get History  # 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_history_with_http_info(did, eid, wvm, wvmid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :return: BTAppElementHistoryInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_history" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `get_history`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `get_history`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `get_history`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `get_history`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/content/history', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementHistoryInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_sub_element_content(self, did, eid, wvm, wvmid, **kwargs):  # noqa: E501
        """Get Content  # 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_sub_element_content(did, eid, wvm, wvmid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str transaction_id:
        :param str change_id:
        :param str base_change_id:
        :param str subelement_id:
        :param str link_document_id:
        :return: BTAppElementContentInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_sub_element_content_with_http_info(did, eid, wvm, wvmid, **kwargs)  # noqa: E501
        else:
            (data) = self.get_sub_element_content_with_http_info(did, eid, wvm, wvmid, **kwargs)  # noqa: E501
            return data

    def get_sub_element_content_with_http_info(self, did, eid, wvm, wvmid, **kwargs):  # noqa: E501
        """Get Content  # 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_sub_element_content_with_http_info(did, eid, wvm, wvmid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str transaction_id:
        :param str change_id:
        :param str base_change_id:
        :param str subelement_id:
        :param str link_document_id:
        :return: BTAppElementContentInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'transaction_id', 'change_id', 'base_change_id', 'subelement_id', 'link_document_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_sub_element_content" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `get_sub_element_content`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `get_sub_element_content`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `get_sub_element_content`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `get_sub_element_content`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501

        query_params = []
        if 'transaction_id' in local_var_params:
            query_params.append(('transactionId', local_var_params['transaction_id']))  # noqa: E501
        if 'change_id' in local_var_params:
            query_params.append(('changeId', local_var_params['change_id']))  # noqa: E501
        if 'base_change_id' in local_var_params:
            query_params.append(('baseChangeId', local_var_params['base_change_id']))  # noqa: E501
        if 'subelement_id' in local_var_params:
            query_params.append(('subelementId', local_var_params['subelement_id']))  # noqa: E501
        if 'link_document_id' in local_var_params:
            query_params.append(('linkDocumentId', local_var_params['link_document_id']))  # 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 = ['OAuth2']  # noqa: E501

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/content', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementContentInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_subelement_ids(self, did, eid, wvm, wvmid, **kwargs):  # noqa: E501
        """Get Sub-element IDs  # 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_subelement_ids(did, eid, wvm, wvmid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str transaction_id:
        :param str change_id:
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_subelement_ids_with_http_info(did, eid, wvm, wvmid, **kwargs)  # noqa: E501
        else:
            (data) = self.get_subelement_ids_with_http_info(did, eid, wvm, wvmid, **kwargs)  # noqa: E501
            return data

    def get_subelement_ids_with_http_info(self, did, eid, wvm, wvmid, **kwargs):  # noqa: E501
        """Get Sub-element IDs  # 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_subelement_ids_with_http_info(did, eid, wvm, wvmid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str transaction_id:
        :param str change_id:
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'transaction_id', 'change_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_subelement_ids" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `get_subelement_ids`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `get_subelement_ids`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `get_subelement_ids`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `get_subelement_ids`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501

        query_params = []
        if 'transaction_id' in local_var_params:
            query_params.append(('transactionId', local_var_params['transaction_id']))  # noqa: E501
        if 'change_id' in local_var_params:
            query_params.append(('changeId', local_var_params['change_id']))  # 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 = ['OAuth2']  # noqa: E501

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/content/ids', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementModifyInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def resolve_reference1(self, did, eid, wvm, wvmid, rid, **kwargs):  # noqa: E501
        """Resolve Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.resolve_reference1(did, eid, wvm, wvmid, rid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str rid: (required)
        :param str transaction_id:
        :param str parent_change_id:
        :param bool include_internal:
        :param str link_document_id:
        :return: BTAppElementReferenceResolveInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.resolve_reference1_with_http_info(did, eid, wvm, wvmid, rid, **kwargs)  # noqa: E501
        else:
            (data) = self.resolve_reference1_with_http_info(did, eid, wvm, wvmid, rid, **kwargs)  # noqa: E501
            return data

    def resolve_reference1_with_http_info(self, did, eid, wvm, wvmid, rid, **kwargs):  # noqa: E501
        """Resolve Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.resolve_reference1_with_http_info(did, eid, wvm, wvmid, rid, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str rid: (required)
        :param str transaction_id:
        :param str parent_change_id:
        :param bool include_internal:
        :param str link_document_id:
        :return: BTAppElementReferenceResolveInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'rid', 'transaction_id', 'parent_change_id', 'include_internal', 'link_document_id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method resolve_reference1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `resolve_reference1`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `resolve_reference1`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `resolve_reference1`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `resolve_reference1`")  # noqa: E501
        # verify the required parameter 'rid' is set
        if ('rid' not in local_var_params or
                local_var_params['rid'] is None):
            raise ValueError("Missing the required parameter `rid` when calling `resolve_reference1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'rid' in local_var_params:
            path_params['rid'] = local_var_params['rid']  # noqa: E501

        query_params = []
        if 'transaction_id' in local_var_params:
            query_params.append(('transactionId', local_var_params['transaction_id']))  # noqa: E501
        if 'parent_change_id' in local_var_params:
            query_params.append(('parentChangeId', local_var_params['parent_change_id']))  # noqa: E501
        if 'include_internal' in local_var_params:
            query_params.append(('includeInternal', local_var_params['include_internal']))  # noqa: E501
        if 'link_document_id' in local_var_params:
            query_params.append(('linkDocumentId', local_var_params['link_document_id']))  # 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 = ['OAuth2']  # noqa: E501

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/references/{rid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementReferenceResolveInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def start_transaction(self, did, eid, wid, bt_app_element_start_transaction_params, **kwargs):  # noqa: E501
        """Start Transaction  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_transaction(did, eid, wid, bt_app_element_start_transaction_params, async_req=True)
        >>> result = thread.get()

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

    def start_transaction_with_http_info(self, did, eid, wid, bt_app_element_start_transaction_params, **kwargs):  # noqa: E501
        """Start Transaction  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_transaction_with_http_info(did, eid, wid, bt_app_element_start_transaction_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wid: (required)
        :param BTAppElementStartTransactionParams bt_app_element_start_transaction_params: (required)
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wid', 'bt_app_element_start_transaction_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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method start_transaction" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `start_transaction`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `start_transaction`")  # noqa: E501
        # verify the required parameter 'wid' is set
        if ('wid' not in local_var_params or
                local_var_params['wid'] is None):
            raise ValueError("Missing the required parameter `wid` when calling `start_transaction`")  # noqa: E501
        # verify the required parameter 'bt_app_element_start_transaction_params' is set
        if ('bt_app_element_start_transaction_params' not in local_var_params or
                local_var_params['bt_app_element_start_transaction_params'] is None):
            raise ValueError("Missing the required parameter `bt_app_element_start_transaction_params` when calling `start_transaction`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wid' in local_var_params:
            path_params['wid'] = local_var_params['wid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json;charset=UTF-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/w/{wid}/e/{eid}/transactions', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementModifyInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update5(self, did, eid, wvm, wvmid, bt_app_element_update_params, **kwargs):  # noqa: E501
        """Update Element  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update5(did, eid, wvm, wvmid, bt_app_element_update_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param BTAppElementUpdateParams bt_app_element_update_params: (required)
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update5_with_http_info(did, eid, wvm, wvmid, bt_app_element_update_params, **kwargs)  # noqa: E501
        else:
            (data) = self.update5_with_http_info(did, eid, wvm, wvmid, bt_app_element_update_params, **kwargs)  # noqa: E501
            return data

    def update5_with_http_info(self, did, eid, wvm, wvmid, bt_app_element_update_params, **kwargs):  # noqa: E501
        """Update Element  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update5_with_http_info(did, eid, wvm, wvmid, bt_app_element_update_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param BTAppElementUpdateParams bt_app_element_update_params: (required)
        :return: BTAppElementModifyInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'bt_app_element_update_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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update5" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `update5`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `update5`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `update5`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `update5`")  # noqa: E501
        # verify the required parameter 'bt_app_element_update_params' is set
        if ('bt_app_element_update_params' not in local_var_params or
                local_var_params['bt_app_element_update_params'] is None):
            raise ValueError("Missing the required parameter `bt_app_element_update_params` when calling `update5`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json;charset=UTF-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/content', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementModifyInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_reference1(self, did, eid, wvm, wvmid, rid, bt_app_element_reference_params, **kwargs):  # noqa: E501
        """Update Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_reference1(did, eid, wvm, wvmid, rid, bt_app_element_reference_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str rid: (required)
        :param BTAppElementReferenceParams bt_app_element_reference_params: (required)
        :return: BTAppElementReferenceInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_reference1_with_http_info(did, eid, wvm, wvmid, rid, bt_app_element_reference_params, **kwargs)  # noqa: E501
        else:
            (data) = self.update_reference1_with_http_info(did, eid, wvm, wvmid, rid, bt_app_element_reference_params, **kwargs)  # noqa: E501
            return data

    def update_reference1_with_http_info(self, did, eid, wvm, wvmid, rid, bt_app_element_reference_params, **kwargs):  # noqa: E501
        """Update Reference  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_reference1_with_http_info(did, eid, wvm, wvmid, rid, bt_app_element_reference_params, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str did: (required)
        :param str eid: (required)
        :param str wvm: (required)
        :param str wvmid: (required)
        :param str rid: (required)
        :param BTAppElementReferenceParams bt_app_element_reference_params: (required)
        :return: BTAppElementReferenceInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['did', 'eid', 'wvm', 'wvmid', 'rid', 'bt_app_element_reference_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')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_reference1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'did' is set
        if ('did' not in local_var_params or
                local_var_params['did'] is None):
            raise ValueError("Missing the required parameter `did` when calling `update_reference1`")  # noqa: E501
        # verify the required parameter 'eid' is set
        if ('eid' not in local_var_params or
                local_var_params['eid'] is None):
            raise ValueError("Missing the required parameter `eid` when calling `update_reference1`")  # noqa: E501
        # verify the required parameter 'wvm' is set
        if ('wvm' not in local_var_params or
                local_var_params['wvm'] is None):
            raise ValueError("Missing the required parameter `wvm` when calling `update_reference1`")  # noqa: E501
        # verify the required parameter 'wvmid' is set
        if ('wvmid' not in local_var_params or
                local_var_params['wvmid'] is None):
            raise ValueError("Missing the required parameter `wvmid` when calling `update_reference1`")  # noqa: E501
        # verify the required parameter 'rid' is set
        if ('rid' not in local_var_params or
                local_var_params['rid'] is None):
            raise ValueError("Missing the required parameter `rid` when calling `update_reference1`")  # noqa: E501
        # verify the required parameter 'bt_app_element_reference_params' is set
        if ('bt_app_element_reference_params' not in local_var_params or
                local_var_params['bt_app_element_reference_params'] is None):
            raise ValueError("Missing the required parameter `bt_app_element_reference_params` when calling `update_reference1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'did' in local_var_params:
            path_params['did'] = local_var_params['did']  # noqa: E501
        if 'eid' in local_var_params:
            path_params['eid'] = local_var_params['eid']  # noqa: E501
        if 'wvm' in local_var_params:
            path_params['wvm'] = local_var_params['wvm']  # noqa: E501
        if 'wvmid' in local_var_params:
            path_params['wvmid'] = local_var_params['wvmid']  # noqa: E501
        if 'rid' in local_var_params:
            path_params['rid'] = local_var_params['rid']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json;charset=UTF-8'])  # noqa: E501

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

        return self.api_client.call_api(
            '/api/appelements/d/{did}/{wvm}/{wvmid}/e/{eid}/references/{rid}', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BTAppElementReferenceInfo',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
