/**
 * Onshape REST API
 * The Onshape REST API consumed by all clients.
 *
 * OpenAPI spec version: 1.93
 * Contact: api-support@onshape.zendesk.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import localVarRequest = require('request');
import http = require('http');
import Promise = require('bluebird');

/* tslint:disable:no-unused-locals */
import { BTBoundingBox } from '../model/bTBoundingBox';
import { BTDocumentElementInfo } from '../model/bTDocumentElementInfo';
import { BTExportModelBodiesResponse } from '../model/bTExportModelBodiesResponse';
import { BTExportTessellatedEdgesResponse } from '../model/bTExportTessellatedEdgesResponse';
import { BTExportTessellatedFacesResponse } from '../model/bTExportTessellatedFacesResponse';
import { BTFeatureDefinitionResponse } from '../model/bTFeatureDefinitionResponse';
import { BTFeatureListResponse } from '../model/bTFeatureListResponse';
import { BTIdTranslationInfo } from '../model/bTIdTranslationInfo';
import { BTIdTranslationParams } from '../model/bTIdTranslationParams';
import { BTMassPropResponse } from '../model/bTMassPropResponse';
import { BTModelElementParams } from '../model/bTModelElementParams';
import { BTModelFormatInfo } from '../model/bTModelFormatInfo';
import { BTNamedViewsInfo } from '../model/bTNamedViewsInfo';
import { BTShadedRenderDocumentResponse } from '../model/bTShadedRenderDocumentResponse';
import { BTTranslateFormatParams } from '../model/bTTranslateFormatParams';
import { BTTranslationRequestInfo } from '../model/bTTranslationRequestInfo';
import { OpenAPI } from '../model/openAPI';

import { ObjectSerializer, Authentication, HttpBasicAuth, ApiKeyAuth, OAuth, VoidAuth } from '../model/models';

let defaultBasePath = 'http://localhost';

// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================

export enum DefaultApiApiKeys {
}

export class DefaultApi {
    protected _basePath = defaultBasePath;
    protected defaultHeaders : any = {};
    protected _useQuerystring : boolean = false;

    protected authentications = {
        'default': <Authentication>new VoidAuth(),
        'OAuth2': new OAuth(),
    }

    constructor(basePath?: string);
    constructor(basePathOrUsername: string, password?: string, basePath?: string) {
        if (password) {
            if (basePath) {
                this.basePath = basePath;
            }
        } else {
            if (basePathOrUsername) {
                this.basePath = basePathOrUsername
            }
        }
    }

    set useQuerystring(value: boolean) {
        this._useQuerystring = value;
    }

    set basePath(basePath: string) {
        this._basePath = basePath;
    }

    get basePath() {
        return this._basePath;
    }

    public setDefaultAuthentication(auth: Authentication) {
        this.authentications.default = auth;
    }

    public setApiKey(key: DefaultApiApiKeys, value: string) {
        (this.authentications as any)[DefaultApiApiKeys[key]].apiKey = value;
    }

    set accessToken(token: string) {
        this.authentications.OAuth2.accessToken = token;
    }

    /**
     * 
     * @summary Add Feature
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param body feature The serialized feature definition
     */
    public addFeature1 (did: string, wvm: string, wvmid: string, eid: string, body?: string) : Promise<{ response: http.ClientResponse; body: BTFeatureDefinitionResponse;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/features'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling addFeature1.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling addFeature1.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling addFeature1.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling addFeature1.');
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'POST',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
            body: ObjectSerializer.serialize(body, "string")
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTFeatureDefinitionResponse;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTFeatureDefinitionResponse");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Create Part Studio
     * @param did Document ID.
     * @param wid Workspace ID.
     * @param bTModelElementParams 
     */
    public createPartStudio (did: string, wid: string, bTModelElementParams: BTModelElementParams) : Promise<{ response: http.ClientResponse; body: BTDocumentElementInfo;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/w/{wid}'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wid' + '}', encodeURIComponent(String(wid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling createPartStudio.');
        }

        // verify required parameter 'wid' is not null or undefined
        if (wid === null || wid === undefined) {
            throw new Error('Required parameter wid was null or undefined when calling createPartStudio.');
        }

        // verify required parameter 'bTModelElementParams' is not null or undefined
        if (bTModelElementParams === null || bTModelElementParams === undefined) {
            throw new Error('Required parameter bTModelElementParams was null or undefined when calling createPartStudio.');
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'POST',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
            body: ObjectSerializer.serialize(bTModelElementParams, "BTModelElementParams")
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTDocumentElementInfo;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTDocumentElementInfo");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Export Part Studio to Parasolid
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param partIds IDs of the parts to retrieve. Repeat query param to add more than one, i.e. partId&#x3D;JHK&amp;partId&#x3D;JHD). May not be combined with other ID filters
     * @param version Parasolid version
     * @param includeExportIds Whether topolgy ids should be exported as parasolid attributes
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public exportPS1 (did: string, wvm: string, wvmid: string, eid: string, partIds?: string, version?: string, includeExportIds?: boolean, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body?: any;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/parasolid'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling exportPS1.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling exportPS1.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling exportPS1.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling exportPS1.');
        }

        if (partIds !== undefined) {
            localVarQueryParameters['partIds'] = ObjectSerializer.serialize(partIds, "string");
        }

        if (version !== undefined) {
            localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "string");
        }

        if (includeExportIds !== undefined) {
            localVarQueryParameters['includeExportIds'] = ObjectSerializer.serialize(includeExportIds, "boolean");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body?: any;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Export Part Studio to STL
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param partIds IDs of the parts to retrieve. Repeat query param to add more than one, i.e. partId&#x3D;JHK&amp;partId&#x3D;JHD). May not be combined with other ID filters
     * @param mode Type of file: text, binary
     * @param grouping Whether parts should be exported as a group or individually in a .zip file
     * @param scale Scale for measurements.
     * @param units Name of base unit (meter, centimeter, millimeter, inch, foot, or yard)
     * @param angleTolerance Angle tolerance (in radians). This specifies the limit on the sum of the angular deviations of a tessellation chord from the tangent vectors at two chord endpoints. The specified value must be less than PI/2. This parameter currently has a default value chosen based on the complexity of the parts being tessellated.
     * @param chordTolerance Chord tolerance (in meters). This specifies the limit on the maximum deviation of a tessellation chord from the true surface/edge. This parameter currently has a default value chosen based on the size and complexity of the parts being tessellated.
     * @param maxFacetWidth Max facet width. This specifies the limit on the size of any side of a tessellation facet.
     * @param minFacetWidth Max facet width. This specifies the limit on the size of any side of a tessellation facet.
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public exportStl1 (did: string, wvm: string, wvmid: string, eid: string, partIds?: string, mode?: string, grouping?: boolean, scale?: number, units?: string, angleTolerance?: number, chordTolerance?: number, maxFacetWidth?: number, minFacetWidth?: number, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body?: any;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/stl'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling exportStl1.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling exportStl1.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling exportStl1.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling exportStl1.');
        }

        if (partIds !== undefined) {
            localVarQueryParameters['partIds'] = ObjectSerializer.serialize(partIds, "string");
        }

        if (mode !== undefined) {
            localVarQueryParameters['mode'] = ObjectSerializer.serialize(mode, "string");
        }

        if (grouping !== undefined) {
            localVarQueryParameters['grouping'] = ObjectSerializer.serialize(grouping, "boolean");
        }

        if (scale !== undefined) {
            localVarQueryParameters['scale'] = ObjectSerializer.serialize(scale, "number");
        }

        if (units !== undefined) {
            localVarQueryParameters['units'] = ObjectSerializer.serialize(units, "string");
        }

        if (angleTolerance !== undefined) {
            localVarQueryParameters['angleTolerance'] = ObjectSerializer.serialize(angleTolerance, "number");
        }

        if (chordTolerance !== undefined) {
            localVarQueryParameters['chordTolerance'] = ObjectSerializer.serialize(chordTolerance, "number");
        }

        if (maxFacetWidth !== undefined) {
            localVarQueryParameters['maxFacetWidth'] = ObjectSerializer.serialize(maxFacetWidth, "number");
        }

        if (minFacetWidth !== undefined) {
            localVarQueryParameters['minFacetWidth'] = ObjectSerializer.serialize(minFacetWidth, "number");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body?: any;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Array of body information
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public getBodyDetails2 (did: string, wvm: string, wvmid: string, eid: string, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body: Array<BTExportModelBodiesResponse>;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/bodydetails'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getBodyDetails2.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getBodyDetails2.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getBodyDetails2.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getBodyDetails2.');
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: Array<BTExportModelBodiesResponse>;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "Array<BTExportModelBodiesResponse>");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Mass properties of parts or a PartStudio.
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param includeHidden Whether or not to include bounding boxes for hidden parts.
     * @param includeWireBodies Whether to include wire bodies in the bounding box.
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public getBoundingBoxes2 (did: string, wvm: string, wvmid: string, eid: string, includeHidden?: boolean, includeWireBodies?: boolean, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body: BTBoundingBox;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/boundingboxes'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getBoundingBoxes2.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getBoundingBoxes2.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getBoundingBoxes2.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getBoundingBoxes2.');
        }

        if (includeHidden !== undefined) {
            localVarQueryParameters['includeHidden'] = ObjectSerializer.serialize(includeHidden, "boolean");
        }

        if (includeWireBodies !== undefined) {
            localVarQueryParameters['includeWireBodies'] = ObjectSerializer.serialize(includeWireBodies, "boolean");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTBoundingBox;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTBoundingBox");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Tesselated edges from a PartStudio.
     * @param did 
     * @param wvm 
     * @param wvmid 
     * @param eid 
     * @param angleTolerance 
     * @param chordTolerance 
     * @param partId 
     * @param edgeId 
     * @param configuration 
     * @param linkDocumentId 
     */
    public getEdges2 (did: string, wvm: string, wvmid: string, eid: string, angleTolerance?: number, chordTolerance?: number, partId?: Array<string>, edgeId?: Array<string>, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body: BTExportTessellatedEdgesResponse;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/tessellatededges'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getEdges2.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getEdges2.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getEdges2.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getEdges2.');
        }

        if (angleTolerance !== undefined) {
            localVarQueryParameters['angleTolerance'] = ObjectSerializer.serialize(angleTolerance, "number");
        }

        if (chordTolerance !== undefined) {
            localVarQueryParameters['chordTolerance'] = ObjectSerializer.serialize(chordTolerance, "number");
        }

        if (partId !== undefined) {
            localVarQueryParameters['partId'] = ObjectSerializer.serialize(partId, "Array<string>");
        }

        if (edgeId !== undefined) {
            localVarQueryParameters['edgeId'] = ObjectSerializer.serialize(edgeId, "Array<string>");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTExportTessellatedEdgesResponse;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTExportTessellatedEdgesResponse");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Tesselated faces of the parts in the Part Studio.
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param angleTolerance Angle tolerance (in radians). This specifies the limit on the sum of the angular deviations of a tessellation chord from the tangent vectors at two chord endpoints. The specified value must be less than PI/2. This parameter currently has a default value chosen based on the complexity of the parts being tessellated.
     * @param chordTolerance Chord tolerance (in meters). This specifies the limit on the maximum deviation of a tessellation chord from the true surface/edge. This parameter currently has a default value chosen based on the size and complexity of the parts being tessellated.
     * @param maxFacetWidth Max facet width. This specifies the limit on the size of any side of a tessellation facet.
     * @param outputVertexNormals If true, output vertex normals corresponding to surface normals at facet vertex points.
     * @param outputFacetNormals Output facet normals.
     * @param outputTextureCoordinates Output texture coordinates.
     * @param outputIndexTable Output index table.
     * @param partId IDs of the parts to retrieve. Repeat query param to add more than one, i.e. partId&#x3D;JHK&amp;partId&#x3D;JHD). May not be combined with other ID filters
     * @param faceId IDs of the faces to tessellate (repeat query param to add more than one, i.e. faceId&#x3D;JHK&amp;faceId&#x3D;JHD)
     * @param outputErrorFaces Whether or not to output faces that cause an error
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public getFaces2 (did: string, wvm: string, wvmid: string, eid: string, angleTolerance?: number, chordTolerance?: number, maxFacetWidth?: number, outputVertexNormals?: boolean, outputFacetNormals?: boolean, outputTextureCoordinates?: boolean, outputIndexTable?: boolean, partId?: Array<string>, faceId?: Array<string>, outputErrorFaces?: boolean, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body: BTExportTessellatedFacesResponse;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/tessellatedfaces'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getFaces2.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getFaces2.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getFaces2.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getFaces2.');
        }

        if (angleTolerance !== undefined) {
            localVarQueryParameters['angleTolerance'] = ObjectSerializer.serialize(angleTolerance, "number");
        }

        if (chordTolerance !== undefined) {
            localVarQueryParameters['chordTolerance'] = ObjectSerializer.serialize(chordTolerance, "number");
        }

        if (maxFacetWidth !== undefined) {
            localVarQueryParameters['maxFacetWidth'] = ObjectSerializer.serialize(maxFacetWidth, "number");
        }

        if (outputVertexNormals !== undefined) {
            localVarQueryParameters['outputVertexNormals'] = ObjectSerializer.serialize(outputVertexNormals, "boolean");
        }

        if (outputFacetNormals !== undefined) {
            localVarQueryParameters['outputFacetNormals'] = ObjectSerializer.serialize(outputFacetNormals, "boolean");
        }

        if (outputTextureCoordinates !== undefined) {
            localVarQueryParameters['outputTextureCoordinates'] = ObjectSerializer.serialize(outputTextureCoordinates, "boolean");
        }

        if (outputIndexTable !== undefined) {
            localVarQueryParameters['outputIndexTable'] = ObjectSerializer.serialize(outputIndexTable, "boolean");
        }

        if (partId !== undefined) {
            localVarQueryParameters['partId'] = ObjectSerializer.serialize(partId, "Array<string>");
        }

        if (faceId !== undefined) {
            localVarQueryParameters['faceId'] = ObjectSerializer.serialize(faceId, "Array<string>");
        }

        if (outputErrorFaces !== undefined) {
            localVarQueryParameters['outputErrorFaces'] = ObjectSerializer.serialize(outputErrorFaces, "boolean");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTExportTessellatedFacesResponse;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTExportTessellatedFacesResponse");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Get Feature List
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param featureId ID of a feature; repeat query param to add more than one
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     * @param noSketchGeometry Whether or not to output simple sketch info without geometry
     */
    public getFeatures (did: string, wvm: string, wvmid: string, eid: string, featureId?: Array<string>, linkDocumentId?: string, noSketchGeometry?: boolean) : Promise<{ response: http.ClientResponse; body: BTFeatureListResponse;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/features'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getFeatures.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getFeatures.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getFeatures.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getFeatures.');
        }

        if (featureId !== undefined) {
            localVarQueryParameters['featureId'] = ObjectSerializer.serialize(featureId, "Array<string>");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }

        if (noSketchGeometry !== undefined) {
            localVarQueryParameters['noSketchGeometry'] = ObjectSerializer.serialize(noSketchGeometry, "boolean");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTFeatureListResponse;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTFeatureListResponse");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Mass properties of parts or a PartStudio.
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param partId IDs of the parts to retrieve. Repeat query param to add more than one, i.e. partId&#x3D;JHK&amp;partId&#x3D;JHD). May not be combined with other ID filters
     * @param massAsGroup If true, specified parts will be evaluated as a single object instead of individually
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public getMassProperties (did: string, wvm: string, wvmid: string, eid: string, partId?: Array<string>, massAsGroup?: boolean, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body: BTMassPropResponse;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/massproperties'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getMassProperties.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getMassProperties.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getMassProperties.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getMassProperties.');
        }

        if (partId !== undefined) {
            localVarQueryParameters['partId'] = ObjectSerializer.serialize(partId, "Array<string>");
        }

        if (massAsGroup !== undefined) {
            localVarQueryParameters['massAsGroup'] = ObjectSerializer.serialize(massAsGroup, "boolean");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTMassPropResponse;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTMassPropResponse");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Get Named Views
     * @param did Document ID.
     * @param eid Element ID.
     * @param skipPerspective Whether views with a perspective projection should be omitted.
     */
    public getNamedViews2 (did: string, eid: string, skipPerspective?: boolean) : Promise<{ response: http.ClientResponse; body: BTNamedViewsInfo;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/e/{eid}/namedViews'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getNamedViews2.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getNamedViews2.');
        }

        if (skipPerspective !== undefined) {
            localVarQueryParameters['skipPerspective'] = ObjectSerializer.serialize(skipPerspective, "boolean");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTNamedViewsInfo;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTNamedViewsInfo");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary OpenAPI spec documentation for the Onshape REST API.
     * @param fileType The type of file to return. Defaults to JSON.
     * @param excludedTags If an operation contains an excluded tag, it is not returned from this endpoint.
     * @param includedTags Return at most all the operations with tags included in includedTags. If not given, this will default to all tags.
     * @param documentationStatus Only return endpoints that have the specified document status. Default is to return all the keys the user should have access to.
     */
    public getOpenApi (fileType?: 'json' | 'yaml', excludedTags?: string, includedTags?: string, documentationStatus?: Array<'DEVELOPMENT' | 'PRODUCTION' | 'STAGING' | 'EVP' | 'UNSET' | 'INTERNAL'>) : Promise<{ response: http.ClientResponse; body: OpenAPI;  }> {
        const localVarPath = this.basePath + '/api/openapi';
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        if (fileType !== undefined) {
            localVarQueryParameters['fileType'] = ObjectSerializer.serialize(fileType, "'json' | 'yaml'");
        }

        if (excludedTags !== undefined) {
            localVarQueryParameters['excludedTags'] = ObjectSerializer.serialize(excludedTags, "string");
        }

        if (includedTags !== undefined) {
            localVarQueryParameters['includedTags'] = ObjectSerializer.serialize(includedTags, "string");
        }

        if (documentationStatus !== undefined) {
            localVarQueryParameters['documentationStatus'] = ObjectSerializer.serialize(documentationStatus, "Array<'DEVELOPMENT' | 'PRODUCTION' | 'STAGING' | 'EVP' | 'UNSET' | 'INTERNAL'>");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: OpenAPI;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "OpenAPI");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Get Shaded Views
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param viewMatrix 12-number view matrix (comma-separated), or one of the following named views: top, bottom, front, back, left, right The 12 entries in the view matrix form three rows and four columns, which is a linear transformation applied to the model itself. The matrix&#39;s first three columns maps the coordinate axes of the model to the coordinate axes of the view, and the fourth column translates the origin (in meters). The view coordinates have x pointing right, y pointing up, and z pointing towards the viewer, while a front view of the model has x pointing right, y pointing away from the viewer, and z pointing up. For example, the identity matrix viewMatrix&#x3D;1,0,0,0,0,1,0,0,0,0,1,0 corresponds to the top view, and viewMatrix&#x3D;0.612,0.612,0,0,-0.354,0.354,0.707,0,0.707,-0.707,0.707,0 corresponds (approximately) to the isometric view. The first three columns of the view matrix should be orthonormal and have a positive determinant.  If this is not the case, view behavior may be undefined.
     * @param outputHeight Output image height (in pixels)
     * @param outputWidth Output image width (in pixels)
     * @param pixelSize Height and width represented by each pixel (in meters). If the value is 0, the display will be sized to fit the output image dimensions.
     * @param edges The treatment to be applied to edges in the display. Options are show: show visible edges, hide: hide visible edges.
     * @param showAllParts Whether or not all parts should be shown in the element, regardless of user setting. If false, the visibility setting made by the user will be reflected in the image. If true, all parts will be shown.
     * @param includeSurfaces Whether or not surfaces should be shown in the element. It is applicable only when showAllParts is true. If false, surfaces will be excluded. If true, all surfaces will be shown.
     * @param useAntiAliasing If true, an anti-aliasing factor will be used to smooth model boundaries in the final image result. If false, the image will be rasterized at the given resolution. Setting to true can have negative performance implications with respect to rendering time and memory usage. If a high-resolution image is requested and anti-aliasing is turned on, the server may not be able to fulfill the request.
     * @param configuration Configuration string.
     * @param linkDocumentId Id of document that links to the document being accessed. This may provide additional access rights to the document. Allowed only with version (v) path parameter.
     */
    public getShadedViews1 (did: string, wvm: string, wvmid: string, eid: string, viewMatrix?: string, outputHeight?: number, outputWidth?: number, pixelSize?: number, edges?: string, showAllParts?: boolean, includeSurfaces?: boolean, useAntiAliasing?: boolean, configuration?: string, linkDocumentId?: string) : Promise<{ response: http.ClientResponse; body: BTShadedRenderDocumentResponse;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/shadedviews'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getShadedViews1.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling getShadedViews1.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling getShadedViews1.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getShadedViews1.');
        }

        if (viewMatrix !== undefined) {
            localVarQueryParameters['viewMatrix'] = ObjectSerializer.serialize(viewMatrix, "string");
        }

        if (outputHeight !== undefined) {
            localVarQueryParameters['outputHeight'] = ObjectSerializer.serialize(outputHeight, "number");
        }

        if (outputWidth !== undefined) {
            localVarQueryParameters['outputWidth'] = ObjectSerializer.serialize(outputWidth, "number");
        }

        if (pixelSize !== undefined) {
            localVarQueryParameters['pixelSize'] = ObjectSerializer.serialize(pixelSize, "number");
        }

        if (edges !== undefined) {
            localVarQueryParameters['edges'] = ObjectSerializer.serialize(edges, "string");
        }

        if (showAllParts !== undefined) {
            localVarQueryParameters['showAllParts'] = ObjectSerializer.serialize(showAllParts, "boolean");
        }

        if (includeSurfaces !== undefined) {
            localVarQueryParameters['includeSurfaces'] = ObjectSerializer.serialize(includeSurfaces, "boolean");
        }

        if (useAntiAliasing !== undefined) {
            localVarQueryParameters['useAntiAliasing'] = ObjectSerializer.serialize(useAntiAliasing, "boolean");
        }

        if (configuration !== undefined) {
            localVarQueryParameters['configuration'] = ObjectSerializer.serialize(configuration, "string");
        }

        if (linkDocumentId !== undefined) {
            localVarQueryParameters['linkDocumentId'] = ObjectSerializer.serialize(linkDocumentId, "string");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTShadedRenderDocumentResponse;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTShadedRenderDocumentResponse");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Get Translation Formats
     * @param did Document ID.
     * @param wid Workspace ID.
     * @param eid Element ID.
     * @param checkContent     Whether the current content or lack thereof should be considered when determining the available formats. Empty part studios cannot be translated into any format.
     */
    public getTranslatorFormats4 (did: string, wid: string, eid: string, checkContent?: boolean) : Promise<{ response: http.ClientResponse; body: Array<BTModelFormatInfo>;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/w/{wid}/e/{eid}/translationformats'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wid' + '}', encodeURIComponent(String(wid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling getTranslatorFormats4.');
        }

        // verify required parameter 'wid' is not null or undefined
        if (wid === null || wid === undefined) {
            throw new Error('Required parameter wid was null or undefined when calling getTranslatorFormats4.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling getTranslatorFormats4.');
        }

        if (checkContent !== undefined) {
            localVarQueryParameters['checkContent'] = ObjectSerializer.serialize(checkContent, "boolean");
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'GET',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
        };

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: Array<BTModelFormatInfo>;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "Array<BTModelFormatInfo>");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Create Part Studio translation
     * @param did Document ID.
     * @param wv One of w or v corresponding to whether a workspace or version was entered.
     * @param wvid Workspace (w) or Version (v).
     * @param eid Element ID.
     * @param bTTranslateFormatParams 
     */
    public translateFormat5 (did: string, wv: string, wvid: string, eid: string, bTTranslateFormatParams: BTTranslateFormatParams) : Promise<{ response: http.ClientResponse; body: BTTranslationRequestInfo;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wv}/{wvid}/e/{eid}/translations'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wv' + '}', encodeURIComponent(String(wv)))
            .replace('{' + 'wvid' + '}', encodeURIComponent(String(wvid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling translateFormat5.');
        }

        // verify required parameter 'wv' is not null or undefined
        if (wv === null || wv === undefined) {
            throw new Error('Required parameter wv was null or undefined when calling translateFormat5.');
        }

        // verify required parameter 'wvid' is not null or undefined
        if (wvid === null || wvid === undefined) {
            throw new Error('Required parameter wvid was null or undefined when calling translateFormat5.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling translateFormat5.');
        }

        // verify required parameter 'bTTranslateFormatParams' is not null or undefined
        if (bTTranslateFormatParams === null || bTTranslateFormatParams === undefined) {
            throw new Error('Required parameter bTTranslateFormatParams was null or undefined when calling translateFormat5.');
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'POST',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
            body: ObjectSerializer.serialize(bTTranslateFormatParams, "BTTranslateFormatParams")
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTTranslationRequestInfo;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTTranslationRequestInfo");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
    /**
     * 
     * @summary Id Translations
     * @param did Document ID.
     * @param wvm One of w or v or m corresponding to whether a workspace or version or microversion was entered.
     * @param wvmid Workspace (w), Version (v) or Microversion (m) ID.
     * @param eid Element ID.
     * @param bTIdTranslationParams 
     */
    public translateIds1 (did: string, wvm: string, wvmid: string, eid: string, bTIdTranslationParams: BTIdTranslationParams) : Promise<{ response: http.ClientResponse; body: BTIdTranslationInfo;  }> {
        const localVarPath = this.basePath + '/api/partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/idtranslations'
            .replace('{' + 'did' + '}', encodeURIComponent(String(did)))
            .replace('{' + 'wvm' + '}', encodeURIComponent(String(wvm)))
            .replace('{' + 'wvmid' + '}', encodeURIComponent(String(wvmid)))
            .replace('{' + 'eid' + '}', encodeURIComponent(String(eid)));
        let localVarQueryParameters: any = {};
        let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
        let localVarFormParams: any = {};

        // verify required parameter 'did' is not null or undefined
        if (did === null || did === undefined) {
            throw new Error('Required parameter did was null or undefined when calling translateIds1.');
        }

        // verify required parameter 'wvm' is not null or undefined
        if (wvm === null || wvm === undefined) {
            throw new Error('Required parameter wvm was null or undefined when calling translateIds1.');
        }

        // verify required parameter 'wvmid' is not null or undefined
        if (wvmid === null || wvmid === undefined) {
            throw new Error('Required parameter wvmid was null or undefined when calling translateIds1.');
        }

        // verify required parameter 'eid' is not null or undefined
        if (eid === null || eid === undefined) {
            throw new Error('Required parameter eid was null or undefined when calling translateIds1.');
        }

        // verify required parameter 'bTIdTranslationParams' is not null or undefined
        if (bTIdTranslationParams === null || bTIdTranslationParams === undefined) {
            throw new Error('Required parameter bTIdTranslationParams was null or undefined when calling translateIds1.');
        }


        let localVarUseFormData = false;

        let localVarRequestOptions: localVarRequest.Options = {
            method: 'POST',
            qs: localVarQueryParameters,
            headers: localVarHeaderParams,
            uri: localVarPath,
            useQuerystring: this._useQuerystring,
            json: true,
            body: ObjectSerializer.serialize(bTIdTranslationParams, "BTIdTranslationParams")
        };

        this.authentications.OAuth2.applyToRequest(localVarRequestOptions);

        this.authentications.default.applyToRequest(localVarRequestOptions);

        if (Object.keys(localVarFormParams).length) {
            if (localVarUseFormData) {
                (<any>localVarRequestOptions).formData = localVarFormParams;
            } else {
                localVarRequestOptions.form = localVarFormParams;
            }
        }
        return new Promise<{ response: http.ClientResponse; body: BTIdTranslationInfo;  }>((resolve, reject) => {
            localVarRequest(localVarRequestOptions, (error, response, body) => {
                if (error) {
                    reject(error);
                } else {
                    body = ObjectSerializer.deserialize(body, "BTIdTranslationInfo");
                    if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
                        resolve({ response: response, body: body });
                    } else {
                        reject({ response: response, body: body });
                    }
                }
            });
        });
    }
}
