# coding: utf-8

"""
    Onshape REST API

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

    The version of the OpenAPI document: 1.111
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""

from __future__ import absolute_import

# python 2 and python 3 compatibility library
import six
from onshape_client.oas.api_client import ApiClient
from onshape_client.oas.exceptions import ApiTypeError, ApiValueError
from onshape_client.oas.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    int,
    none_type,
    str,
    validate_and_convert_types,
)
from onshape_client.oas.models import bt_acl_info
from onshape_client.oas.models import bt_copy_document_info
from onshape_client.oas.models import bt_copy_document_params
from onshape_client.oas.models import bt_document_element_info
from onshape_client.oas.models import bt_document_info
from onshape_client.oas.models import bt_document_merge_info
from onshape_client.oas.models import bt_document_params
from onshape_client.oas.models import bt_document_search_params
from onshape_client.oas.models import bt_export_model_params
from onshape_client.oas.models import bt_global_tree_node_list_response
from onshape_client.oas.models import bt_insertables_list_response
from onshape_client.oas.models import bt_link_to_latest_document_info
from onshape_client.oas.models import bt_link_to_latest_document_params
from onshape_client.oas.models import bt_microversion_info
from onshape_client.oas.models import bt_move_element_info
from onshape_client.oas.models import bt_move_element_params
from onshape_client.oas.models import bt_share_params
from onshape_client.oas.models import bt_version_info
from onshape_client.oas.models import bt_version_or_workspace_info
from onshape_client.oas.models import bt_version_or_workspace_params
from onshape_client.oas.models import bt_workspace_info


class DocumentsApi(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 __copy_workspace(self, did, wid, **kwargs):
            """Copy Workspace  # noqa: E501

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

            Args:
                did (str):
                wid (str):

            Keyword Args:
                bt_copy_document_params (bt_copy_document_params.BTCopyDocumentParams): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_copy_document_info.BTCopyDocumentInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            return self.call_with_http_info(**kwargs)

        self.copy_workspace = Endpoint(
            settings={
                "response_type": (bt_copy_document_info.BTCopyDocumentInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/workspaces/{wid}/copy",
                "operation_id": "copy_workspace",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid", "bt_copy_document_params",],
                "required": ["did", "wid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wid": (str,),
                    "bt_copy_document_params": (
                        bt_copy_document_params.BTCopyDocumentParams,
                    ),
                },
                "attribute_map": {"did": "did", "wid": "wid",},
                "location_map": {
                    "did": "path",
                    "wid": "path",
                    "bt_copy_document_params": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__copy_workspace,
        )

        def __create_document(self, bt_document_params, **kwargs):
            """Create document.  # 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_document(bt_document_params, async_req=True)
            >>> result = thread.get()

            Args:
                bt_document_params (bt_document_params.BTDocumentParams):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_document_info.BTDocumentInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["bt_document_params"] = bt_document_params
            return self.call_with_http_info(**kwargs)

        self.create_document = Endpoint(
            settings={
                "response_type": (bt_document_info.BTDocumentInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents",
                "operation_id": "create_document",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["bt_document_params",],
                "required": ["bt_document_params",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "bt_document_params": (bt_document_params.BTDocumentParams,),
                },
                "attribute_map": {},
                "location_map": {"bt_document_params": "body",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__create_document,
        )

        def __create_version(self, did, bt_version_or_workspace_params, **kwargs):
            """Create Version.  # 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_version(did, bt_version_or_workspace_params, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                bt_version_or_workspace_params (bt_version_or_workspace_params.BTVersionOrWorkspaceParams):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_version_info.BTVersionInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["bt_version_or_workspace_params"] = bt_version_or_workspace_params
            return self.call_with_http_info(**kwargs)

        self.create_version = Endpoint(
            settings={
                "response_type": (bt_version_info.BTVersionInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/versions",
                "operation_id": "create_version",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "bt_version_or_workspace_params",],
                "required": ["did", "bt_version_or_workspace_params",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "bt_version_or_workspace_params": (
                        bt_version_or_workspace_params.BTVersionOrWorkspaceParams,
                    ),
                },
                "attribute_map": {"did": "did",},
                "location_map": {
                    "did": "path",
                    "bt_version_or_workspace_params": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__create_version,
        )

        def __create_workspace(self, did, **kwargs):
            """Create Workspace  # 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_workspace(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                bt_version_or_workspace_params (bt_version_or_workspace_params.BTVersionOrWorkspaceParams): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_workspace_info.BTWorkspaceInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.create_workspace = Endpoint(
            settings={
                "response_type": (bt_workspace_info.BTWorkspaceInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/workspaces",
                "operation_id": "create_workspace",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "bt_version_or_workspace_params",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "bt_version_or_workspace_params": (
                        bt_version_or_workspace_params.BTVersionOrWorkspaceParams,
                    ),
                },
                "attribute_map": {"did": "did",},
                "location_map": {
                    "did": "path",
                    "bt_version_or_workspace_params": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__create_workspace,
        )

        def __delete_document(self, did, **kwargs):
            """Delete Document  # 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_document(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                forever (bool): [optional] if omitted the server will use the default value of False
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.delete_document = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}",
                "operation_id": "delete_document",
                "http_method": "DELETE",
                "servers": [],
            },
            params_map={
                "all": ["did", "forever",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,), "forever": (bool,),},
                "attribute_map": {"did": "did", "forever": "forever",},
                "location_map": {"did": "path", "forever": "query",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__delete_document,
        )

        def __delete_workspace(self, did, wid, **kwargs):
            """Delete Workspace  # 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_workspace(did, wid, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                wid (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            return self.call_with_http_info(**kwargs)

        self.delete_workspace = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/workspaces/{wid}",
                "operation_id": "delete_workspace",
                "http_method": "DELETE",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid",],
                "required": ["did", "wid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,), "wid": (str,),},
                "attribute_map": {"did": "did", "wid": "wid",},
                "location_map": {"did": "path", "wid": "path",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__delete_workspace,
        )

        def __download_external_data(self, did, fid, **kwargs):
            """Download External Data  # noqa: E501

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

            Args:
                did (str):
                fid (str):

            Keyword Args:
                if_none_match (str): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                file_type
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["fid"] = fid
            return self.call_with_http_info(**kwargs)

        self.download_external_data = Endpoint(
            settings={
                "response_type": (file_type,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/externaldata/{fid}",
                "operation_id": "download_external_data",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did", "fid", "if_none_match",],
                "required": ["did", "fid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "fid": (str,),
                    "if_none_match": (str,),
                },
                "attribute_map": {
                    "did": "did",
                    "fid": "fid",
                    "if_none_match": "If-None-Match",
                },
                "location_map": {
                    "did": "path",
                    "fid": "path",
                    "if_none_match": "header",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                    "application/vnd.onshape.v1+octet-stream;charset=UTF-8;qs=0.1",
                    "application/octet-stream",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__download_external_data,
        )

        def __export2_json(self, did, wv, wvid, eid, **kwargs):
            """export2_json  # noqa: E501

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

            Args:
                did (str):
                wv (str):
                wvid (str):
                eid (str):

            Keyword Args:
                bt_export_model_params (bt_export_model_params.BTExportModelParams): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wv"] = wv
            kwargs["wvid"] = wvid
            kwargs["eid"] = eid
            return self.call_with_http_info(**kwargs)

        self.export2_json = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/{wv}/{wvid}/e/{eid}/export",
                "operation_id": "export2_json",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wv", "wvid", "eid", "bt_export_model_params",],
                "required": ["did", "wv", "wvid", "eid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wv": (str,),
                    "wvid": (str,),
                    "eid": (str,),
                    "bt_export_model_params": (
                        bt_export_model_params.BTExportModelParams,
                    ),
                },
                "attribute_map": {
                    "did": "did",
                    "wv": "wv",
                    "wvid": "wvid",
                    "eid": "eid",
                },
                "location_map": {
                    "did": "path",
                    "wv": "path",
                    "wvid": "path",
                    "eid": "path",
                    "bt_export_model_params": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+octet-stream;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__export2_json,
        )

        def __get_current_microversion(self, did, wv, wvid, **kwargs):
            """Get Current Document Microversion  # 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_current_microversion(did, wv, wvid, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                wv (str):
                wvid (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_microversion_info.BTMicroversionInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wv"] = wv
            kwargs["wvid"] = wvid
            return self.call_with_http_info(**kwargs)

        self.get_current_microversion = Endpoint(
            settings={
                "response_type": (bt_microversion_info.BTMicroversionInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/{wv}/{wvid}/currentmicroversion",
                "operation_id": "get_current_microversion",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did", "wv", "wvid",],
                "required": ["did", "wv", "wvid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,), "wv": (str,), "wvid": (str,),},
                "attribute_map": {"did": "did", "wv": "wv", "wvid": "wvid",},
                "location_map": {"did": "path", "wv": "path", "wvid": "path",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_current_microversion,
        )

        def __get_document(self, did, **kwargs):
            """Get Document  # 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_document(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_document_info.BTDocumentInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.get_document = Endpoint(
            settings={
                "response_type": (bt_document_info.BTDocumentInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}",
                "operation_id": "get_document",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,),},
                "attribute_map": {"did": "did",},
                "location_map": {"did": "path",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_document,
        )

        def __get_document_acl(self, did, **kwargs):
            """Get Access Control List  # 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_document_acl(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_acl_info.BTAclInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.get_document_acl = Endpoint(
            settings={
                "response_type": (bt_acl_info.BTAclInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/acl",
                "operation_id": "get_document_acl",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,),},
                "attribute_map": {"did": "did",},
                "location_map": {"did": "path",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_document_acl,
        )

        def __get_document_permission_set(self, did, **kwargs):
            """Get Document Permissions  # 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_document_permission_set(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bool, date, datetime, dict, float, int, list, str
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.get_document_permission_set = Endpoint(
            settings={
                "response_type": (bool, date, datetime, dict, float, int, list, str,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/permissionset",
                "operation_id": "get_document_permission_set",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,),},
                "attribute_map": {"did": "did",},
                "location_map": {"did": "path",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_document_permission_set,
        )

        def __get_document_versions(self, did, **kwargs):
            """Get Versions  # 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_document_versions(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                offset (int): [optional] if omitted the server will use the default value of 0
                limit (int): [optional] if omitted the server will use the default value of 0
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                [bt_version_info.BTVersionInfo]
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.get_document_versions = Endpoint(
            settings={
                "response_type": ([bt_version_info.BTVersionInfo],),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/versions",
                "operation_id": "get_document_versions",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did", "offset", "limit",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,), "offset": (int,), "limit": (int,),},
                "attribute_map": {"did": "did", "offset": "offset", "limit": "limit",},
                "location_map": {"did": "path", "offset": "query", "limit": "query",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_document_versions,
        )

        def __get_document_workspaces(self, did, **kwargs):
            """Get Workspaces  # 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_document_workspaces(did, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                [bt_workspace_info.BTWorkspaceInfo]
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            return self.call_with_http_info(**kwargs)

        self.get_document_workspaces = Endpoint(
            settings={
                "response_type": ([bt_workspace_info.BTWorkspaceInfo],),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/workspaces",
                "operation_id": "get_document_workspaces",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did",],
                "required": ["did",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,),},
                "attribute_map": {"did": "did",},
                "location_map": {"did": "path",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_document_workspaces,
        )

        def __get_documents(self, **kwargs):
            """Get Documents  # 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_documents(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                q (str): [optional] if omitted the server will use the default value of ''
                filter (int): [optional]
                owner (str): [optional] if omitted the server will use the default value of ''
                owner_type (int): [optional] if omitted the server will use the default value of 1
                sort_column (str): [optional] if omitted the server will use the default value of 'createdAt'
                sort_order (str): [optional] if omitted the server will use the default value of 'desc'
                offset (int): [optional] if omitted the server will use the default value of 0
                limit (int): [optional] if omitted the server will use the default value of 20
                label (str): [optional]
                project (str): [optional]
                parent_id (str): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_global_tree_node_list_response.BTGlobalTreeNodeListResponse
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            return self.call_with_http_info(**kwargs)

        self.get_documents = Endpoint(
            settings={
                "response_type": (
                    bt_global_tree_node_list_response.BTGlobalTreeNodeListResponse,
                ),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents",
                "operation_id": "get_documents",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": [
                    "q",
                    "filter",
                    "owner",
                    "owner_type",
                    "sort_column",
                    "sort_order",
                    "offset",
                    "limit",
                    "label",
                    "project",
                    "parent_id",
                ],
                "required": [],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "q": (str,),
                    "filter": (int,),
                    "owner": (str,),
                    "owner_type": (int,),
                    "sort_column": (str,),
                    "sort_order": (str,),
                    "offset": (int,),
                    "limit": (int,),
                    "label": (str,),
                    "project": (str,),
                    "parent_id": (str,),
                },
                "attribute_map": {
                    "q": "q",
                    "filter": "filter",
                    "owner": "owner",
                    "owner_type": "ownerType",
                    "sort_column": "sortColumn",
                    "sort_order": "sortOrder",
                    "offset": "offset",
                    "limit": "limit",
                    "label": "label",
                    "project": "project",
                    "parent_id": "parentId",
                },
                "location_map": {
                    "q": "query",
                    "filter": "query",
                    "owner": "query",
                    "owner_type": "query",
                    "sort_column": "query",
                    "sort_order": "query",
                    "offset": "query",
                    "limit": "query",
                    "label": "query",
                    "project": "query",
                    "parent_id": "query",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_documents,
        )

        def __get_elements_in_document(self, did, wvm, wvmid, **kwargs):
            """Get a list of elements in the workspace, version, or microversion of the document.  # 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_elements_in_document(did, wvm, wvmid, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                wvm (str):
                wvmid (str):

            Keyword Args:
                element_type (str): [optional] if omitted the server will use the default value of ''
                element_id (str): [optional] if omitted the server will use the default value of ''
                with_thumbnails (bool): [optional] if omitted the server will use the default value of False
                link_document_id (str): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                [bt_document_element_info.BTDocumentElementInfo]
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wvm"] = wvm
            kwargs["wvmid"] = wvmid
            return self.call_with_http_info(**kwargs)

        self.get_elements_in_document = Endpoint(
            settings={
                "response_type": ([bt_document_element_info.BTDocumentElementInfo],),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/{wvm}/{wvmid}/elements",
                "operation_id": "get_elements_in_document",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": [
                    "did",
                    "wvm",
                    "wvmid",
                    "element_type",
                    "element_id",
                    "with_thumbnails",
                    "link_document_id",
                ],
                "required": ["did", "wvm", "wvmid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wvm": (str,),
                    "wvmid": (str,),
                    "element_type": (str,),
                    "element_id": (str,),
                    "with_thumbnails": (bool,),
                    "link_document_id": (str,),
                },
                "attribute_map": {
                    "did": "did",
                    "wvm": "wvm",
                    "wvmid": "wvmid",
                    "element_type": "elementType",
                    "element_id": "elementId",
                    "with_thumbnails": "withThumbnails",
                    "link_document_id": "linkDocumentId",
                },
                "location_map": {
                    "did": "path",
                    "wvm": "path",
                    "wvmid": "path",
                    "element_type": "query",
                    "element_id": "query",
                    "with_thumbnails": "query",
                    "link_document_id": "query",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_elements_in_document,
        )

        def __get_insertables(self, did, wvm, wvmid, **kwargs):
            """Insertable List for Document Version.  # 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_insertables(did, wvm, wvmid, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                wvm (str):
                wvmid (str):

            Keyword Args:
                beta_capability_ids ([str]): [optional]
                include_parts (bool): [optional] if omitted the server will use the default value of False
                include_surfaces (bool): [optional] if omitted the server will use the default value of False
                include_wires (bool): [optional] if omitted the server will use the default value of False
                include_sketches (bool): [optional] if omitted the server will use the default value of False
                include_reference_features (bool): [optional] if omitted the server will use the default value of False
                include_assemblies (bool): [optional] if omitted the server will use the default value of False
                include_features (bool): [optional] if omitted the server will use the default value of False
                include_feature_studios (bool): [optional] if omitted the server will use the default value of False
                include_part_studios (bool): [optional] if omitted the server will use the default value of False
                include_blobs (bool): [optional] if omitted the server will use the default value of False
                include_meshes (bool): [optional] if omitted the server will use the default value of False
                include_flattened_bodies (bool): [optional] if omitted the server will use the default value of False
                allowed_blob_mime_types (str): [optional] if omitted the server will use the default value of ''
                max_feature_script_version (int): [optional] if omitted the server will use the default value of 0
                include_applications (bool): [optional] if omitted the server will use the default value of False
                allowed_application_mime_types (str): [optional] if omitted the server will use the default value of ''
                include_composite_parts (bool): [optional] if omitted the server will use the default value of False
                include_fs_tables (bool): [optional] if omitted the server will use the default value of False
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_insertables_list_response.BTInsertablesListResponse
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wvm"] = wvm
            kwargs["wvmid"] = wvmid
            return self.call_with_http_info(**kwargs)

        self.get_insertables = Endpoint(
            settings={
                "response_type": (
                    bt_insertables_list_response.BTInsertablesListResponse,
                ),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/{wvm}/{wvmid}/insertables",
                "operation_id": "get_insertables",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": [
                    "did",
                    "wvm",
                    "wvmid",
                    "beta_capability_ids",
                    "include_parts",
                    "include_surfaces",
                    "include_wires",
                    "include_sketches",
                    "include_reference_features",
                    "include_assemblies",
                    "include_features",
                    "include_feature_studios",
                    "include_part_studios",
                    "include_blobs",
                    "include_meshes",
                    "include_flattened_bodies",
                    "allowed_blob_mime_types",
                    "max_feature_script_version",
                    "include_applications",
                    "allowed_application_mime_types",
                    "include_composite_parts",
                    "include_fs_tables",
                ],
                "required": ["did", "wvm", "wvmid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wvm": (str,),
                    "wvmid": (str,),
                    "beta_capability_ids": ([str],),
                    "include_parts": (bool,),
                    "include_surfaces": (bool,),
                    "include_wires": (bool,),
                    "include_sketches": (bool,),
                    "include_reference_features": (bool,),
                    "include_assemblies": (bool,),
                    "include_features": (bool,),
                    "include_feature_studios": (bool,),
                    "include_part_studios": (bool,),
                    "include_blobs": (bool,),
                    "include_meshes": (bool,),
                    "include_flattened_bodies": (bool,),
                    "allowed_blob_mime_types": (str,),
                    "max_feature_script_version": (int,),
                    "include_applications": (bool,),
                    "allowed_application_mime_types": (str,),
                    "include_composite_parts": (bool,),
                    "include_fs_tables": (bool,),
                },
                "attribute_map": {
                    "did": "did",
                    "wvm": "wvm",
                    "wvmid": "wvmid",
                    "beta_capability_ids": "betaCapabilityIds",
                    "include_parts": "includeParts",
                    "include_surfaces": "includeSurfaces",
                    "include_wires": "includeWires",
                    "include_sketches": "includeSketches",
                    "include_reference_features": "includeReferenceFeatures",
                    "include_assemblies": "includeAssemblies",
                    "include_features": "includeFeatures",
                    "include_feature_studios": "includeFeatureStudios",
                    "include_part_studios": "includePartStudios",
                    "include_blobs": "includeBlobs",
                    "include_meshes": "includeMeshes",
                    "include_flattened_bodies": "includeFlattenedBodies",
                    "allowed_blob_mime_types": "allowedBlobMimeTypes",
                    "max_feature_script_version": "maxFeatureScriptVersion",
                    "include_applications": "includeApplications",
                    "allowed_application_mime_types": "allowedApplicationMimeTypes",
                    "include_composite_parts": "includeCompositeParts",
                    "include_fs_tables": "includeFSTables",
                },
                "location_map": {
                    "did": "path",
                    "wvm": "path",
                    "wvmid": "path",
                    "beta_capability_ids": "query",
                    "include_parts": "query",
                    "include_surfaces": "query",
                    "include_wires": "query",
                    "include_sketches": "query",
                    "include_reference_features": "query",
                    "include_assemblies": "query",
                    "include_features": "query",
                    "include_feature_studios": "query",
                    "include_part_studios": "query",
                    "include_blobs": "query",
                    "include_meshes": "query",
                    "include_flattened_bodies": "query",
                    "allowed_blob_mime_types": "query",
                    "max_feature_script_version": "query",
                    "include_applications": "query",
                    "allowed_application_mime_types": "query",
                    "include_composite_parts": "query",
                    "include_fs_tables": "query",
                },
                "collection_format_map": {"beta_capability_ids": "multi",},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_insertables,
        )

        def __get_version(self, did, vid, **kwargs):
            """Get Version  # 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_version(did, vid, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                vid (str):

            Keyword Args:
                parents (bool): [optional] if omitted the server will use the default value of False
                link_document_id (str): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_version_info.BTVersionInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["vid"] = vid
            return self.call_with_http_info(**kwargs)

        self.get_version = Endpoint(
            settings={
                "response_type": (bt_version_info.BTVersionInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/versions/{vid}",
                "operation_id": "get_version",
                "http_method": "GET",
                "servers": [],
            },
            params_map={
                "all": ["did", "vid", "parents", "link_document_id",],
                "required": ["did", "vid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "vid": (str,),
                    "parents": (bool,),
                    "link_document_id": (str,),
                },
                "attribute_map": {
                    "did": "did",
                    "vid": "vid",
                    "parents": "parents",
                    "link_document_id": "linkDocumentId",
                },
                "location_map": {
                    "did": "path",
                    "vid": "path",
                    "parents": "query",
                    "link_document_id": "query",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__get_version,
        )

        def __merge_into_workspace(
            self, did, wid, bt_version_or_workspace_info, **kwargs
        ):
            """Merge into workspace  # noqa: E501

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

            Args:
                did (str):
                wid (str):
                bt_version_or_workspace_info (bt_version_or_workspace_info.BTVersionOrWorkspaceInfo):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_document_merge_info.BTDocumentMergeInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            kwargs["bt_version_or_workspace_info"] = bt_version_or_workspace_info
            return self.call_with_http_info(**kwargs)

        self.merge_into_workspace = Endpoint(
            settings={
                "response_type": (bt_document_merge_info.BTDocumentMergeInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/workspaces/{wid}/merge",
                "operation_id": "merge_into_workspace",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid", "bt_version_or_workspace_info",],
                "required": ["did", "wid", "bt_version_or_workspace_info",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wid": (str,),
                    "bt_version_or_workspace_info": (
                        bt_version_or_workspace_info.BTVersionOrWorkspaceInfo,
                    ),
                },
                "attribute_map": {"did": "did", "wid": "wid",},
                "location_map": {
                    "did": "path",
                    "wid": "path",
                    "bt_version_or_workspace_info": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__merge_into_workspace,
        )

        def __move_elements_to_document(
            self, did, wid, bt_move_element_params, **kwargs
        ):
            """Move Elements  # noqa: E501

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

            Args:
                did (str):
                wid (str):
                bt_move_element_params (bt_move_element_params.BTMoveElementParams):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_move_element_info.BTMoveElementInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            kwargs["bt_move_element_params"] = bt_move_element_params
            return self.call_with_http_info(**kwargs)

        self.move_elements_to_document = Endpoint(
            settings={
                "response_type": (bt_move_element_info.BTMoveElementInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/w/{wid}/moveelement",
                "operation_id": "move_elements_to_document",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid", "bt_move_element_params",],
                "required": ["did", "wid", "bt_move_element_params",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wid": (str,),
                    "bt_move_element_params": (
                        bt_move_element_params.BTMoveElementParams,
                    ),
                },
                "attribute_map": {"did": "did", "wid": "wid",},
                "location_map": {
                    "did": "path",
                    "wid": "path",
                    "bt_move_element_params": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__move_elements_to_document,
        )

        def __restore_from_history(self, did, wid, vm, vmid, **kwargs):
            """Restore version or microversion to workspace.  # noqa: E501

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

            Args:
                did (str):
                wid (str):
                vm (str):
                vmid (str):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            kwargs["vm"] = vm
            kwargs["vmid"] = vmid
            return self.call_with_http_info(**kwargs)

        self.restore_from_history = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/w/{wid}/restore/{vm}/{vmid}",
                "operation_id": "restore_from_history",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid", "vm", "vmid",],
                "required": ["did", "wid", "vm", "vmid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wid": (str,),
                    "vm": (str,),
                    "vmid": (str,),
                },
                "attribute_map": {
                    "did": "did",
                    "wid": "wid",
                    "vm": "vm",
                    "vmid": "vmid",
                },
                "location_map": {
                    "did": "path",
                    "wid": "path",
                    "vm": "path",
                    "vmid": "path",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__restore_from_history,
        )

        def __search(self, bt_document_search_params, **kwargs):
            """search  # noqa: E501

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

            Args:
                bt_document_search_params (bt_document_search_params.BTDocumentSearchParams):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["bt_document_search_params"] = bt_document_search_params
            return self.call_with_http_info(**kwargs)

        self.search = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/search",
                "operation_id": "search",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["bt_document_search_params",],
                "required": ["bt_document_search_params",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "bt_document_search_params": (
                        bt_document_search_params.BTDocumentSearchParams,
                    ),
                },
                "attribute_map": {},
                "location_map": {"bt_document_search_params": "body",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__search,
        )

        def __share_document(self, did, bt_share_params, **kwargs):
            """Share Document  # noqa: E501

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

            Args:
                did (str):
                bt_share_params (bt_share_params.BTShareParams):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_acl_info.BTAclInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["bt_share_params"] = bt_share_params
            return self.call_with_http_info(**kwargs)

        self.share_document = Endpoint(
            settings={
                "response_type": (bt_acl_info.BTAclInfo,),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/share",
                "operation_id": "share_document",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "bt_share_params",],
                "required": ["did", "bt_share_params",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "bt_share_params": (bt_share_params.BTShareParams,),
                },
                "attribute_map": {"did": "did",},
                "location_map": {"did": "path", "bt_share_params": "body",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__share_document,
        )

        def __sync_application_elements(
            self, did, wid, application_element_ids, **kwargs
        ):
            """Sync Application Elements  # noqa: E501

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

            Args:
                did (str):
                wid (str):
                application_element_ids ([str]):

            Keyword Args:
                description (str): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            kwargs["application_element_ids"] = application_element_ids
            return self.call_with_http_info(**kwargs)

        self.sync_application_elements = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/w/{wid}/syncApplicationElements",
                "operation_id": "sync_application_elements",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid", "application_element_ids", "description",],
                "required": ["did", "wid", "application_element_ids",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wid": (str,),
                    "application_element_ids": ([str],),
                    "description": (str,),
                },
                "attribute_map": {
                    "did": "did",
                    "wid": "wid",
                    "application_element_ids": "applicationElementIds",
                    "description": "description",
                },
                "location_map": {
                    "did": "path",
                    "wid": "path",
                    "application_element_ids": "query",
                    "description": "query",
                },
                "collection_format_map": {"application_element_ids": "multi",},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__sync_application_elements,
        )

        def __un_share_document(self, did, eid, **kwargs):
            """Unshare Document  # noqa: E501

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

            Args:
                did (str):
                eid (str):

            Keyword Args:
                entry_type (int): [optional] if omitted the server will use the default value of 0
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["eid"] = eid
            return self.call_with_http_info(**kwargs)

        self.un_share_document = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}/share/{eid}",
                "operation_id": "un_share_document",
                "http_method": "DELETE",
                "servers": [],
            },
            params_map={
                "all": ["did", "eid", "entry_type",],
                "required": ["did", "eid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {"did": (str,), "eid": (str,), "entry_type": (int,),},
                "attribute_map": {
                    "did": "did",
                    "eid": "eid",
                    "entry_type": "entryType",
                },
                "location_map": {"did": "path", "eid": "path", "entry_type": "query",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": [],
            },
            api_client=api_client,
            callable=__un_share_document,
        )

        def __update_document_attributes(self, did, bt_document_params, **kwargs):
            """Update Document Attributes.  # 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_document_attributes(did, bt_document_params, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                bt_document_params (bt_document_params.BTDocumentParams):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["bt_document_params"] = bt_document_params
            return self.call_with_http_info(**kwargs)

        self.update_document_attributes = Endpoint(
            settings={
                "response_type": None,
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/{did}",
                "operation_id": "update_document_attributes",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "bt_document_params",],
                "required": ["did", "bt_document_params",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "bt_document_params": (bt_document_params.BTDocumentParams,),
                },
                "attribute_map": {"did": "did",},
                "location_map": {"did": "path", "bt_document_params": "body",},
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__update_document_attributes,
        )

        def __update_external_references_to_latest_documents(
            self, did, wid, eid, **kwargs
        ):
            """Update External References to Latest  # 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_external_references_to_latest_documents(did, wid, eid, async_req=True)
            >>> result = thread.get()

            Args:
                did (str):
                wid (str):
                eid (str):

            Keyword Args:
                bt_link_to_latest_document_params (bt_link_to_latest_document_params.BTLinkToLatestDocumentParams): [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int): specifies the index of the server
                    that we want to use.
                    Default is 0.
                async_req (bool): execute request asynchronously

            Returns:
                bt_link_to_latest_document_info.BTLinkToLatestDocumentInfo
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs["async_req"] = kwargs.get("async_req", False)
            kwargs["_return_http_data_only"] = kwargs.get(
                "_return_http_data_only", True
            )
            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
            kwargs["_host_index"] = kwargs.get("_host_index", 0)
            kwargs["did"] = did
            kwargs["wid"] = wid
            kwargs["eid"] = eid
            return self.call_with_http_info(**kwargs)

        self.update_external_references_to_latest_documents = Endpoint(
            settings={
                "response_type": (
                    bt_link_to_latest_document_info.BTLinkToLatestDocumentInfo,
                ),
                "auth": ["OAuth2"],
                "endpoint_path": "/api/documents/d/{did}/w/{wid}/e/{eid}/latestdocumentreferences",
                "operation_id": "update_external_references_to_latest_documents",
                "http_method": "POST",
                "servers": [],
            },
            params_map={
                "all": ["did", "wid", "eid", "bt_link_to_latest_document_params",],
                "required": ["did", "wid", "eid",],
                "nullable": [],
                "enum": [],
                "validation": [],
            },
            root_map={
                "validations": {},
                "allowed_values": {},
                "openapi_types": {
                    "did": (str,),
                    "wid": (str,),
                    "eid": (str,),
                    "bt_link_to_latest_document_params": (
                        bt_link_to_latest_document_params.BTLinkToLatestDocumentParams,
                    ),
                },
                "attribute_map": {"did": "did", "wid": "wid", "eid": "eid",},
                "location_map": {
                    "did": "path",
                    "wid": "path",
                    "eid": "path",
                    "bt_link_to_latest_document_params": "body",
                },
                "collection_format_map": {},
            },
            headers_map={
                "accept": [
                    "application/vnd.onshape.v1+json;charset=UTF-8;qs=0.1",
                    "application/json;charset=UTF-8; qs=0.09",
                ],
                "content_type": ["application/json;charset=UTF-8; qs=0.09"],
            },
            api_client=api_client,
            callable=__update_external_references_to_latest_documents,
        )


class Endpoint(object):
    def __init__(
        self,
        settings=None,
        params_map=None,
        root_map=None,
        headers_map=None,
        api_client=None,
        callable=None,
    ):
        """Creates an endpoint

        Args:
            settings (dict): see below key value pairs
                'response_type' (tuple/None): response type
                'auth' (list): a list of auth type keys
                'endpoint_path' (str): the endpoint path
                'operation_id' (str): endpoint string identifier
                'http_method' (str): POST/PUT/PATCH/GET etc
                'servers' (list): list of str servers that this endpoint is at
            params_map (dict): see below key value pairs
                'all' (list): list of str endpoint parameter names
                'required' (list): list of required parameter names
                'nullable' (list): list of nullable parameter names
                'enum' (list): list of parameters with enum values
                'validation' (list): list of parameters with validations
            root_map
                'validations' (dict): the dict mapping endpoint parameter tuple
                    paths to their validation dictionaries
                'allowed_values' (dict): the dict mapping endpoint parameter
                    tuple paths to their allowed_values (enum) dictionaries
                'openapi_types' (dict): param_name to openapi type
                'attribute_map' (dict): param_name to camelCase name
                'location_map' (dict): param_name to  'body', 'file', 'form',
                    'header', 'path', 'query'
                collection_format_map (dict): param_name to `csv` etc.
            headers_map (dict): see below key value pairs
                'accept' (list): list of Accept header strings
                'content_type' (list): list of Content-Type header strings
            api_client (ApiClient) api client instance
            callable (function): the function which is invoked when the
                Endpoint is called
        """
        self.settings = settings
        self.params_map = params_map
        self.params_map["all"].extend(
            [
                "async_req",
                "_host_index",
                "_preload_content",
                "_request_timeout",
                "_return_http_data_only",
                "_check_input_type",
                "_check_return_type",
            ]
        )
        self.params_map["nullable"].extend(["_request_timeout"])
        self.validations = root_map["validations"]
        self.allowed_values = root_map["allowed_values"]
        self.openapi_types = root_map["openapi_types"]
        extra_types = {
            "async_req": (bool,),
            "_host_index": (int,),
            "_preload_content": (bool,),
            "_request_timeout": (none_type, int, (int,), [int]),
            "_return_http_data_only": (bool,),
            "_check_input_type": (bool,),
            "_check_return_type": (bool,),
        }
        self.openapi_types.update(extra_types)
        self.attribute_map = root_map["attribute_map"]
        self.location_map = root_map["location_map"]
        self.collection_format_map = root_map["collection_format_map"]
        self.headers_map = headers_map
        self.api_client = api_client
        self.callable = callable

    def __validate_inputs(self, kwargs):
        for param in self.params_map["enum"]:
            if param in kwargs:
                check_allowed_values(self.allowed_values, (param,), kwargs[param])

        for param in self.params_map["validation"]:
            if param in kwargs:
                check_validations(self.validations, (param,), kwargs[param])

        if kwargs["_check_input_type"] is False:
            return

        for key, value in six.iteritems(kwargs):
            fixed_val = validate_and_convert_types(
                value,
                self.openapi_types[key],
                [key],
                False,
                kwargs["_check_input_type"],
                configuration=self.api_client.configuration,
            )
            kwargs[key] = fixed_val

    def __gather_params(self, kwargs):
        params = {
            "body": None,
            "collection_format": {},
            "file": {},
            "form": [],
            "header": {},
            "path": {},
            "query": [],
        }

        for param_name, param_value in six.iteritems(kwargs):
            param_location = self.location_map.get(param_name)
            if param_location is None:
                continue
            if param_location:
                if param_location == "body":
                    params["body"] = param_value
                    continue
                base_name = self.attribute_map[param_name]
                if param_location == "form" and self.openapi_types[param_name] == (
                    file_type,
                ):
                    params["file"][param_name] = [param_value]
                elif param_location == "form" and self.openapi_types[param_name] == (
                    [file_type],
                ):
                    # param_value is already a list
                    params["file"][param_name] = param_value
                elif param_location in {"form", "query"}:
                    param_value_full = (base_name, param_value)
                    params[param_location].append(param_value_full)
                if param_location not in {"form", "query"}:
                    params[param_location][base_name] = param_value
                collection_format = self.collection_format_map.get(param_name)
                if collection_format:
                    params["collection_format"][base_name] = collection_format

        return params

    def __call__(self, *args, **kwargs):
        """ This method is invoked when endpoints are called
        Example:
        pet_api = PetApi()
        pet_api.add_pet  # this is an instance of the class Endpoint
        pet_api.add_pet()  # this invokes pet_api.add_pet.__call__()
        which then invokes the callable functions stored in that endpoint at
        pet_api.add_pet.callable or self.callable in this class
        """
        return self.callable(self, *args, **kwargs)

    def call_with_http_info(self, **kwargs):

        try:
            _host = self.settings["servers"][kwargs["_host_index"]]
        except IndexError:
            if self.settings["servers"]:
                raise ApiValueError(
                    "Invalid host index. Must be 0 <= index < %s"
                    % len(self.settings["servers"])
                )
            _host = None

        for key, value in six.iteritems(kwargs):
            if key not in self.params_map["all"]:
                raise ApiTypeError(
                    "Got an unexpected parameter '%s'"
                    " to method `%s`" % (key, self.settings["operation_id"])
                )
            # only throw this nullable ApiValueError if _check_input_type
            # is False, if _check_input_type==True we catch this case
            # in self.__validate_inputs
            if (
                key not in self.params_map["nullable"]
                and value is None
                and kwargs["_check_input_type"] is False
            ):
                raise ApiValueError(
                    "Value may not be None for non-nullable parameter `%s`"
                    " when calling `%s`" % (key, self.settings["operation_id"])
                )

        for key in self.params_map["required"]:
            if key not in kwargs.keys():
                raise ApiValueError(
                    "Missing the required parameter `%s` when calling "
                    "`%s`" % (key, self.settings["operation_id"])
                )

        self.__validate_inputs(kwargs)

        params = self.__gather_params(kwargs)

        accept_headers_list = self.headers_map["accept"]
        if accept_headers_list:
            params["header"]["Accept"] = self.api_client.select_header_accept(
                accept_headers_list
            )

        content_type_headers_list = self.headers_map["content_type"]
        if content_type_headers_list:
            header_list = self.api_client.select_header_content_type(
                content_type_headers_list
            )
            params["header"]["Content-Type"] = header_list

        return self.api_client.call_api(
            self.settings["endpoint_path"],
            self.settings["http_method"],
            params["path"],
            params["query"],
            params["header"],
            body=params["body"],
            post_params=params["form"],
            files=params["file"],
            response_type=self.settings["response_type"],
            auth_settings=self.settings["auth"],
            async_req=kwargs["async_req"],
            _check_type=kwargs["_check_return_type"],
            _return_http_data_only=kwargs["_return_http_data_only"],
            _preload_content=kwargs["_preload_content"],
            _request_timeout=kwargs["_request_timeout"],
            _host=_host,
            collection_formats=params["collection_format"],
        )
