-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathDerivativesApi.js
More file actions
591 lines (517 loc) · 27.4 KB
/
DerivativesApi.js
File metadata and controls
591 lines (517 loc) · 27.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
/**
* Forge SDK
* The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.
*
* Contact: forge.help@autodesk.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*jshint esversion: 9 */
module.exports = (function () {
'use strict';
var ApiClient = require('../ApiClient'),
Diagnostics = require('../model/Diagnostics'),
Formats = require('../model/Formats'),
Job = require('../model/Job'),
JobPayload = require('../model/JobPayload'),
Manifest = require('../model/Manifest'),
Metadata = require('../model/Metadata'),
Result = require('../model/Result'),
DerivativeDownloadUrl = require('../model/DerivativeDownloadUrl');
/**
* Derivatives service.
* @module api/DerivativesApi
*/
/**
* Constructs a new DerivativesApi.
* @alias module:api/DerivativesApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function (apiClient, region) {
this.apiClient = apiClient || ApiClient.instance;
this.region = region || 'US'; // US is default
this.regionPaths = {
US: '/modelderivative/v2',
EMEA: '/modelderivative/v2/regions/eu',
EU: '/modelderivative/v2/regions/eu', // EU == EMEA
};
/**
* Returns an up-to-date list of Forge-supported translations, that you can use to identify which types of derivatives are supported for each source file type. You can set this endpoint to only return the list of supported translations if they have been updated since a specified date. See the [Supported Translation Formats table](https://developer.autodesk.com/en/docs/model-derivative/v2/overview/supported-translations) for more details about supported translations. Note that we are constantly adding new file formats to the list of Forge translations.
* @param {Object} opts Optional parameters
* @param {Date} opts.ifModifiedSince The supported formats are only returned if they were modified since the specified date. An invalid date returns the latest supported format list. If the supported formats have not been modified since the specified date, the endpoint returns a `NOT MODIFIED` (304) response.
* @param {String} opts.acceptEncoding If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format.
* data is of type: {module:model/Formats}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getFormats = function (opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
var pathParams = {};
var queryParams = {};
var headerParams = {
'If-Modified-Since': opts.ifModifiedSince,
'Accept-Encoding': opts.acceptEncoding
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Formats;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/formats', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Translate a source file from one format to another. Derivatives are stored in a manifest that is updated each time this endpoint is used on a source file. Note that this endpoint is asynchronous and initiates a process that runs in the background, rather than keeping an open HTTP connection until completion. Use the [GET {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET) endpoint to poll for the job’s completion.
* @param {module:model/JobPayload} job
* @param {Object} opts Optional parameters
* @param {Boolean} opts.xAdsForce `true`: the endpoint replaces previously translated output file types with the newly generated derivatives `false` (default): previously created derivatives are not replaced (default to false)
* data is of type: {module:model/Job}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.translate = function (job, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = job;
// verify the required parameter 'job' is set
if (job == undefined || job == null) {
return Promise.reject("Missing the required parameter 'job' when calling translate");
}
var pathParams = {};
var queryParams = {};
var headerParams = {
'x-ads-force': opts.xAdsForce
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Job;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/job', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* To create references for a composite design in Model Derivative. The description of references is stored in Model Derivative. To use it with the POST job endpoint, you need to set checkReferences to true.
* @param {String} urn The root design urn. Mandatory if the base64 encoded urn in the request URL is a logical urn.
* @param {Object} body
* @param {Object} opts Optional parameters
* data is of type: {Object}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.setReferences = function (urn, body, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = body;
// verify the required parameter 'urn' is set
if (urn === undefined || urn === null) {
return Promise.reject("Missing the required parameter 'urn' when calling setReferences");
}
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
return Promise.reject("Missing the required parameter 'body' when calling setReferences");
}
var pathParams = {
urn: urn
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/references', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Returns the thumbnail for the source file.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {Object} opts Optional parameters
* @param {String} opts.guid Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID
* @param {Integer} opts.width The desired width of the thumbnail. Possible values are 100, 200 and 400.
* @param {Integer} opts.height The desired height of the thumbnail. Possible values are 100, 200 and 400.
* data is of type: {Object}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getThumbnail = function (urn, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getThumbnail");
}
var pathParams = {
'urn': urn
};
var queryParams = {
'width': opts.width,
'height': opts.height,
'guid': opts.guid
};
var headerParams = {};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/octet-stream'];
var returnType = Object;
var responseType = 'arraybuffer';
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/thumbnail', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials, responseType
);
};
/**
* Returns information about derivatives that correspond to a specific source file, including derviative URNs and statuses. The URNs of the derivatives are used to download the generated derivatives when calling the [GET {urn}/manifest/{derivativeurn}](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-derivativeurn-GET) endpoint. The statuses are used to verify whether the translation of requested output files is complete. Note that different output files might complete their translation processes at different times, and therefore may have different status values. When translating a source file a second time, the previously created manifest is not deleted; it appends the information (only new translations) to the manifest.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {Object} opts Optional parameters
* @param {String} opts.acceptEncoding If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format.
* data is of type: {module:model/Manifest}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getManifest = function (urn, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getManifest");
}
var pathParams = {
'urn': urn
};
var queryParams = {};
var headerParams = {
'Accept-Encoding': opts.acceptEncoding
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Manifest;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/manifest', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Deletes the manifest and all its translated output files (derivatives). However, it does not delete the design source file.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* data is of type: {module:model/Result}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.deleteManifest = function (urn, oauth2client, credentials) {
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling deleteManifest");
}
var pathParams = {
'urn': urn
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Result;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/manifest', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Downloads a selected derivative. To download the file, you need to specify the file’s URN, which you retrieve by calling the [GET {urn}/manifest](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-GET) endpoint. Note that the Model Derivative API uses 2 types of URNs. The **design URN** is generated when you upload the source design file to Forge, and is used when calling most of the Model Derivative endpoints. A **derivative URN** is generated for each translated output file format, and is used for downloading the output design files. You can set the range of bytes that are returned when downloading the derivative, using the range header.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {String} derivativeUrn The URL-encoded URN of the derivatives. The URN is retrieved from the GET :urn/manifest endpoint.
* @param {Object} opts Optional parameters
* @param {Integer} opts.range This is the standard RFC 2616 range request header. It only supports one range specifier per request: 1. Range:bytes=0-63 (returns the first 64 bytes) 2. Range:bytes=64-127 (returns the second set of 64 bytes) 3. Range:bytes=1022- (returns all the bytes from offset 1022 to the end) 4. If the range header is not specified, the whole content is returned.
* @param {String} opts.acceptEncoding If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format.
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getDerivativeManifest = function (urn, derivativeUrn, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getDerivativeManifest");
}
// verify the required parameter 'derivativeUrn' is set
if (derivativeUrn == undefined || derivativeUrn == null) {
return Promise.reject("Missing the required parameter 'derivativeUrn' when calling getDerivativeManifest");
}
var pathParams = {
'urn': urn,
'derivativeUrn': derivativeUrn
};
var queryParams = {};
var headerParams = {
'Range': opts.range,
'Accept-Encoding': opts.acceptEncoding, // 'deflate, gzip, br'
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/octet-stream'];
var returnType = null;
var responseType = 'arraybuffer';
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/manifest/{derivativeUrn}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials, responseType
);
};
/**
* Returns information about the specified derivative.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {String} derivativeUrn The URL-encoded URN of the derivatives. The URN is retrieved from the GET :urn/manifest endpoint.
* @param {Object} opts Optional parameters
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getDerivativeManifestInfo = function (urn, derivativeUrn, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getDerivativeManifest");
}
// verify the required parameter 'derivativeUrn' is set
if (derivativeUrn == undefined || derivativeUrn == null) {
return Promise.reject("Missing the required parameter 'derivativeUrn' when calling getDerivativeManifest");
}
var pathParams = {
'urn': urn,
'derivativeUrn': derivativeUrn
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/manifest/{derivativeUrn}', 'HEAD',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Returns a download URL and a set of signed cookies, which lets you securely download the derivative specified by the derivativeUrn URI parameter.
* The signed cookies have a lifetime of 6 hours.
* Although you cannot use range headers for this endpoint, you can use range headers for the returned download URL to download the derivative in chunks, in parallel.
* See: https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-manifest-derivativeUrn-signedcookies-GET/
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {String} derivativeUrn The URL-encoded URN of the derivatives. The URN is retrieved from the GET :urn/manifest endpoint.
* @param {Object} opts Optional parameters
* @param {Integer} opts.minutesExpiration Specifies how many minutes the signed cookies should remain valid. Default value is 360 minutes. The value you specify must be lower than the default value for this parameter. If you specify a value greater than the default value, the Model Derivative service will return an error with an HTTP status code of 400.
* @param {String} opts.responseContentDisposition The value that must be returned with the download URL as the response-content-disposition query string parameter. Must begin with attachment. This value defaults to the default value corresponding to the derivative/file.
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getDerivativeDownloadUrl = function (urn, derivativeUrn, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getDerivativeDownloadUrl");
}
// verify the required parameter 'derivativeUrn' is set
if (derivativeUrn == undefined || derivativeUrn == null) {
return Promise.reject("Missing the required parameter 'derivativeUrn' when calling getDerivativeDownloadUrl");
}
var pathParams = {
'urn': urn,
'derivativeUrn': derivativeUrn
};
var queryParams = {
'minutes-expiration': opts.minutesExpiration,
'response-content-disposition': opts.responseContentDisposition
};
var headerParams = {};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['*/*'];
var returnType = DerivativeDownloadUrl;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/manifest/{derivativeUrn}/signedcookies', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Returns a list of model view (metadata) IDs for a design model. The metadata ID enables end users to select an object tree and properties for a specific model view. Although most design apps (e.g., Fusion and Inventor) only allow a single model view (object tree and set of properties), some apps (e.g., Revit) allow users to design models with multiple model views (e.g., HVAC, architecture, perspective). Note that you can only retrieve metadata from an input file that has been translated into an SVF file.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {Object} opts Optional parameters
* @param {String} opts.acceptEncoding If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format.
* data is of type: {module:model/Metadata}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getMetadata = function (urn, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getMetadata");
}
var pathParams = {
'urn': urn
};
var queryParams = {};
var headerParams = {
'Accept-Encoding': opts.acceptEncoding
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Metadata;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/metadata', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Returns an object tree, i.e., a hierarchical list of objects for a model view. To call this endpoint you first need to call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, to determine which model view (object tree and set of properties) to use. Although most design apps (e.g., Fusion and Inventor) only allow a single model view, some apps (e.g., Revit) allow users to design models with multiple model views (e.g., HVAC, architecture, perspective). Note that you can only retrieve metadata from an input file that has been translated into an SVF file.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {String} guid Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID
* @param {Object} opts Optional parameters
* @param {String} opts.acceptEncoding If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format.
* @param {Boolean} opts.xAdsForce Force retrieve the object tree even though it failed to be extracted (got 404 - NOT_FOUND with error message) previously. (default is false) retrieve the object tree, and previously failures are not replaced.
* @param {String} opts.xAdsFormat fallback: fallback to SVF format; latest: returns SVF2 if available. Possible values: latest / fallback; Default to latest.
* @param {Boolean} opts.forceget To force get the large resource even if it exceeded the expected maximum length (20 MB). Possible values: true, false. The the implicit value is false.
* data is of type: {module:model/Metadata}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getModelviewMetadata = function (urn, guid, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getModelviewMetadata");
}
// verify the required parameter 'guid' is set
if (guid == undefined || guid == null) {
return Promise.reject("Missing the required parameter 'guid' when calling getModelviewMetadata");
}
var pathParams = {
'urn': urn,
'guid': guid
};
var queryParams = {
'forceget': opts.forceget || false
};
var headerParams = {
'Accept-Encoding': opts.acceptEncoding,
'x-ads-force': opts.xAdsForce || false,
'x-ads-derivative-format': opts.xAdsFormat || 'latest'
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Metadata;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/metadata/{guid}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
/**
* Returns a list of properties for each object in an object tree. Properties are returned according to object ID and do not follow a hierarchical structure. The following image displays a typical list of properties for a Revit object:  To call this endpoint you need to first call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, which returns a list of model view (metadata) IDs for a design input model. Select a model view (metadata) ID to use when calling the Get Properties endpoint. Note that you can only get properties from a design input file that was previously translated into an SVF file.
* @param {String} urn The Base64 (URL Safe) encoded design URN
* @param {String} guid Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID
* @param {Object} opts Optional parameters
* @param {String} opts.acceptEncoding If specified with `gzip` or `*`, content will be compressed and returned in a GZIP format.
* @param {Boolean} opts.xAdsForce Force retrieve the object tree even though it failed to be extracted (got 404 - NOT_FOUND with error message) previously. (default is false) retrieve the object tree, and previously failures are not replaced.
* @param {String} opts.xAdsFormat fallback: fallback to SVF format; latest: returns SVF2 if available. Possible values: latest / fallback; Default to latest.
* @param {Boolean} opts.forceget To force get the large resource even if it exceeded the expected maximum length (20 MB). Possible values: true, false. The the implicit value is false.
* @param {Integer} opts.objectid Object id which you want to query properties for.
* data is of type: {module:model/Metadata}
* @param {Object} oauth2client oauth2client for the call
* @param {Object} credentials credentials for the call
*/
this.getModelviewProperties = function (urn, guid, opts, oauth2client, credentials) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'urn' is set
if (urn == undefined || urn == null) {
return Promise.reject("Missing the required parameter 'urn' when calling getModelviewProperties");
}
// verify the required parameter 'guid' is set
if (guid == undefined || guid == null) {
return Promise.reject("Missing the required parameter 'guid' when calling getModelviewProperties");
}
var pathParams = {
'urn': urn,
'guid': guid
};
var queryParams = {
'forceget': opts.forceget || false,
'objectid': opts.objectid || null
};
var headerParams = {
'Accept-Encoding': opts.acceptEncoding,
'x-ads-force': opts.xAdsForce || false,
'x-ads-derivative-format': opts.xAdsFormat || 'latest'
};
var formParams = {};
var contentTypes = ['application/json'];
var accepts = ['application/vnd.api+json', 'application/json'];
var returnType = Metadata;
return this.apiClient.callApi(
this.regionPaths[this.region] + '/designdata/{urn}/metadata/{guid}/properties', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
contentTypes, accepts, returnType, oauth2client, credentials
);
};
};
/**
* Allowed values for the <code>region</code> property.
* @enum {String}
* @readonly
*/
exports.RegionEnum = {
/**
* value: "US"
* @const
*/
"US": "US",
/**
* value: "EMEA"
* @const
*/
"EMEA": "EMEA",
/**
* value: "EU"
* @const
*/
"EU": "EMEA",
};
return exports;
}());