Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit d2c284a

Browse files
committed
PATCH: restore viewpoint patch (#706)
* restore viewpoint patch * use ModelViewSet
1 parent 3efddd5 commit d2c284a

File tree

10 files changed

+326
-3
lines changed

10 files changed

+326
-3
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ docs/PatchedTopicTypeRequest.md
126126
docs/PatchedUnitRequest.md
127127
docs/PatchedUserCloudUpdateRequest.md
128128
docs/PatchedUserProjectUpdateRequest.md
129+
docs/PatchedViewpointRequest.md
129130
docs/PatchedVisaCommentRequest.md
130131
docs/PatchedVisaRequest.md
131132
docs/PatchedVisaValidationRequest.md
@@ -374,6 +375,7 @@ src/model/PatchedTopicTypeRequest.js
374375
src/model/PatchedUnitRequest.js
375376
src/model/PatchedUserCloudUpdateRequest.js
376377
src/model/PatchedUserProjectUpdateRequest.js
378+
src/model/PatchedViewpointRequest.js
377379
src/model/PatchedVisaCommentRequest.js
378380
src/model/PatchedVisaRequest.js
379381
src/model/PatchedVisaValidationRequest.js
@@ -616,6 +618,7 @@ test/model/PatchedTopicTypeRequest.spec.js
616618
test/model/PatchedUnitRequest.spec.js
617619
test/model/PatchedUserCloudUpdateRequest.spec.js
618620
test/model/PatchedUserProjectUpdateRequest.spec.js
621+
test/model/PatchedViewpointRequest.spec.js
619622
test/model/PatchedVisaCommentRequest.spec.js
620623
test/model/PatchedVisaRequest.spec.js
621624
test/model/PatchedVisaValidationRequest.spec.js

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Class | Method | HTTP request | Description
202202
*bimdata.BcfApi* | [**updateFullTopic**](docs/BcfApi.md#updateFullTopic) | **PATCH** /bcf/2.1/projects/{projects_pk}/full-topic/{guid} | Update some fields of a topic
203203
*bimdata.BcfApi* | [**updatePin**](docs/BcfApi.md#updatePin) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{viewpoints_guid}/pin/{guid} | Update some fields of a Pin
204204
*bimdata.BcfApi* | [**updateTopic**](docs/BcfApi.md#updateTopic) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{guid} | Update some fields of a topic
205+
*bimdata.BcfApi* | [**updateViewpoint**](docs/BcfApi.md#updateViewpoint) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid} | Update some fields of a Viewpoint
205206
*bimdata.CollaborationApi* | [**acceptUserInvitation**](docs/CollaborationApi.md#acceptUserInvitation) | **POST** /user/invitations/{id}/accept | Accept an invitation
206207
*bimdata.CollaborationApi* | [**acceptValidation**](docs/CollaborationApi.md#acceptValidation) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/validation/{id}/accept | Accept a validation
207208
*bimdata.CollaborationApi* | [**addDocumentTag**](docs/CollaborationApi.md#addDocumentTag) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/tag | Add a tag to a document
@@ -741,6 +742,7 @@ Class | Method | HTTP request | Description
741742
- [bimdata.PatchedUnitRequest](docs/PatchedUnitRequest.md)
742743
- [bimdata.PatchedUserCloudUpdateRequest](docs/PatchedUserCloudUpdateRequest.md)
743744
- [bimdata.PatchedUserProjectUpdateRequest](docs/PatchedUserProjectUpdateRequest.md)
745+
- [bimdata.PatchedViewpointRequest](docs/PatchedViewpointRequest.md)
744746
- [bimdata.PatchedVisaCommentRequest](docs/PatchedVisaCommentRequest.md)
745747
- [bimdata.PatchedVisaRequest](docs/PatchedVisaRequest.md)
746748
- [bimdata.PatchedVisaValidationRequest](docs/PatchedVisaValidationRequest.md)

docs/BcfApi.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Method | HTTP request | Description
6565
[**updateFullTopic**](BcfApi.md#updateFullTopic) | **PATCH** /bcf/2.1/projects/{projects_pk}/full-topic/{guid} | Update some fields of a topic
6666
[**updatePin**](BcfApi.md#updatePin) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{viewpoints_guid}/pin/{guid} | Update some fields of a Pin
6767
[**updateTopic**](BcfApi.md#updateTopic) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{guid} | Update some fields of a topic
68+
[**updateViewpoint**](BcfApi.md#updateViewpoint) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid} | Update some fields of a Viewpoint
6869

6970

7071

@@ -4050,3 +4051,74 @@ Name | Type | Description | Notes
40504051
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
40514052
- **Accept**: application/json
40524053

4054+
4055+
## updateViewpoint
4056+
4057+
> Viewpoint updateViewpoint(guid, projectsPk, topicsGuid, opts)
4058+
4059+
Update some fields of a Viewpoint
4060+
4061+
This is not a standard route. Update some fields of a Viewpoint Required scopes: bcf:write
4062+
4063+
### Example
4064+
4065+
```javascript
4066+
import bimdata from '@bimdata/bimdata-api-client';
4067+
let defaultClient = bimdata.ApiClient.instance;
4068+
// Configure API key authorization: ApiKey
4069+
let ApiKey = defaultClient.authentications['ApiKey'];
4070+
ApiKey.apiKey = 'YOUR API KEY';
4071+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
4072+
//ApiKey.apiKeyPrefix = 'Token';
4073+
// Configure OAuth2 access token for authorization: BIMData_Connect
4074+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
4075+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
4076+
// Configure OAuth2 access token for authorization: BIMData_Connect
4077+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
4078+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
4079+
// Configure API key authorization: Bearer
4080+
let Bearer = defaultClient.authentications['Bearer'];
4081+
Bearer.apiKey = 'YOUR API KEY';
4082+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
4083+
//Bearer.apiKeyPrefix = 'Token';
4084+
4085+
let apiInstance = new bimdata.BcfApi();
4086+
let guid = "guid_example"; // String |
4087+
let projectsPk = 56; // Number |
4088+
let topicsGuid = "topicsGuid_example"; // String |
4089+
let opts = {
4090+
'imgFormat': "imgFormat_example", // String | All snapshot_data will be returned as url instead of base64
4091+
'patchedViewpointRequest': new bimdata.PatchedViewpointRequest() // PatchedViewpointRequest |
4092+
};
4093+
apiInstance.updateViewpoint(guid, projectsPk, topicsGuid, opts).then((data) => {
4094+
console.log('API called successfully. Returned data: ' + data);
4095+
}, (error) => {
4096+
console.error(error);
4097+
});
4098+
4099+
```
4100+
4101+
### Parameters
4102+
4103+
4104+
Name | Type | Description | Notes
4105+
------------- | ------------- | ------------- | -------------
4106+
**guid** | **String**| |
4107+
**projectsPk** | **Number**| |
4108+
**topicsGuid** | **String**| |
4109+
**imgFormat** | **String**| All snapshot_data will be returned as url instead of base64 | [optional]
4110+
**patchedViewpointRequest** | [**PatchedViewpointRequest**](PatchedViewpointRequest.md)| | [optional]
4111+
4112+
### Return type
4113+
4114+
[**Viewpoint**](Viewpoint.md)
4115+
4116+
### Authorization
4117+
4118+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
4119+
4120+
### HTTP request headers
4121+
4122+
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
4123+
- **Accept**: application/json
4124+

docs/CollaborationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ Name | Type | Description | Notes
955955
956956
Create a document
957957

958-
Create a document. If the document is one of {'DWG', 'DXF', 'OBJ', 'IFC', 'POINT_CLOUD', 'GLTF'}, a model will be created and attached to this document Required scopes: document:write
958+
Create a document. If the document is one of {'GLTF', 'DWG', 'DXF', 'POINT_CLOUD', 'IFC', 'OBJ'}, a model will be created and attached to this document Required scopes: document:write
959959

960960
### Example
961961

docs/PatchedViewpointRequest.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# bimdata.PatchedViewpointRequest
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**index** | **Number** | | [optional]
8+
**guid** | **String** | | [optional]
9+
**originatingSystem** | **String** | Name of the system in which the viewpoint is originated | [optional]
10+
**authoringToolId** | **String** | System specific identifier of the viewpoint in the originating BIM tool | [optional]
11+
**orthogonalCamera** | [**OrthogonalCameraRequest**](OrthogonalCameraRequest.md) | | [optional]
12+
**perspectiveCamera** | [**PerspectiveCameraRequest**](PerspectiveCameraRequest.md) | | [optional]
13+
**lines** | [**[LineRequest]**](LineRequest.md) | | [optional]
14+
**clippingPlanes** | [**[ClippingPlaneRequest]**](ClippingPlaneRequest.md) | | [optional]
15+
**snapshot** | [**SnapshotRequest**](SnapshotRequest.md) | | [optional]
16+
**components** | [**ComponentsParentRequest**](ComponentsParentRequest.md) | | [optional]
17+
**pins** | [**[PinRequest]**](PinRequest.md) | Non standard field. Pins (or markers/annotations) are points of interest. When creating a Viewpoint you can create pins with the fields `pins`, but you can't edit pins through here. You must use dedicated pin routes. | [optional]
18+
**tempId** | **Number** | Only used when using POST on the full-topic route to bind viewpoint with comment | [optional]
19+
**models** | **[Number]** | | [optional]
20+
21+

src/api/BcfApi.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import PatchedStageRequest from '../model/PatchedStageRequest';
3636
import PatchedTopicRequest from '../model/PatchedTopicRequest';
3737
import PatchedTopicStatusRequest from '../model/PatchedTopicStatusRequest';
3838
import PatchedTopicTypeRequest from '../model/PatchedTopicTypeRequest';
39+
import PatchedViewpointRequest from '../model/PatchedViewpointRequest';
3940
import Pin from '../model/Pin';
4041
import PinRequest from '../model/PinRequest';
4142
import Priority from '../model/Priority';
@@ -3658,4 +3659,74 @@ export default class BcfApi {
36583659
}
36593660

36603661

3662+
/**
3663+
* Update some fields of a Viewpoint
3664+
* This is not a standard route. Update some fields of a Viewpoint Required scopes: bcf:write
3665+
* @param {String} guid
3666+
* @param {Number} projectsPk
3667+
* @param {String} topicsGuid
3668+
* @param {Object} opts Optional parameters
3669+
* @param {module:model/String} opts.imgFormat All snapshot_data will be returned as url instead of base64
3670+
* @param {module:model/PatchedViewpointRequest} opts.patchedViewpointRequest
3671+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Viewpoint} and HTTP response
3672+
*/
3673+
updateViewpointWithHttpInfo(guid, projectsPk, topicsGuid, opts) {
3674+
opts = opts || {};
3675+
let postBody = opts['patchedViewpointRequest'];
3676+
// verify the required parameter 'guid' is set
3677+
if (guid === undefined || guid === null) {
3678+
throw new Error("Missing the required parameter 'guid' when calling updateViewpoint");
3679+
}
3680+
// verify the required parameter 'projectsPk' is set
3681+
if (projectsPk === undefined || projectsPk === null) {
3682+
throw new Error("Missing the required parameter 'projectsPk' when calling updateViewpoint");
3683+
}
3684+
// verify the required parameter 'topicsGuid' is set
3685+
if (topicsGuid === undefined || topicsGuid === null) {
3686+
throw new Error("Missing the required parameter 'topicsGuid' when calling updateViewpoint");
3687+
}
3688+
3689+
let pathParams = {
3690+
'guid': guid,
3691+
'projects_pk': projectsPk,
3692+
'topics_guid': topicsGuid
3693+
};
3694+
let queryParams = {
3695+
'img_format': opts['imgFormat']
3696+
};
3697+
let headerParams = {
3698+
};
3699+
let formParams = {
3700+
};
3701+
3702+
let authNames = ['ApiKey', 'BIMData_Connect', 'BIMData_Connect', 'Bearer'];
3703+
let contentTypes = ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'];
3704+
let accepts = ['application/json'];
3705+
let returnType = Viewpoint;
3706+
return this.apiClient.callApi(
3707+
'/bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid}', 'PATCH',
3708+
pathParams, queryParams, headerParams, formParams, postBody,
3709+
authNames, contentTypes, accepts, returnType, null
3710+
);
3711+
}
3712+
3713+
/**
3714+
* Update some fields of a Viewpoint
3715+
* This is not a standard route. Update some fields of a Viewpoint Required scopes: bcf:write
3716+
* @param {String} guid
3717+
* @param {Number} projectsPk
3718+
* @param {String} topicsGuid
3719+
* @param {Object} opts Optional parameters
3720+
* @param {module:model/String} opts.imgFormat All snapshot_data will be returned as url instead of base64
3721+
* @param {module:model/PatchedViewpointRequest} opts.patchedViewpointRequest
3722+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Viewpoint}
3723+
*/
3724+
updateViewpoint(guid, projectsPk, topicsGuid, opts) {
3725+
return this.updateViewpointWithHttpInfo(guid, projectsPk, topicsGuid, opts)
3726+
.then(function(response_and_data) {
3727+
return response_and_data.data;
3728+
});
3729+
}
3730+
3731+
36613732
}

src/api/CollaborationApi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export default class CollaborationApi {
858858

859859
/**
860860
* Create a document
861-
* Create a document. If the document is one of {'DWG', 'DXF', 'OBJ', 'IFC', 'POINT_CLOUD', 'GLTF'}, a model will be created and attached to this document Required scopes: document:write
861+
* Create a document. If the document is one of {'GLTF', 'DWG', 'DXF', 'POINT_CLOUD', 'IFC', 'OBJ'}, a model will be created and attached to this document Required scopes: document:write
862862
* @param {Number} cloudPk A unique integer value identifying this cloud.
863863
* @param {Number} projectPk A unique integer value identifying this project.
864864
* @param {String} name Shown name of the file
@@ -924,7 +924,7 @@ export default class CollaborationApi {
924924

925925
/**
926926
* Create a document
927-
* Create a document. If the document is one of {'DWG', 'DXF', 'OBJ', 'IFC', 'POINT_CLOUD', 'GLTF'}, a model will be created and attached to this document Required scopes: document:write
927+
* Create a document. If the document is one of {'GLTF', 'DWG', 'DXF', 'POINT_CLOUD', 'IFC', 'OBJ'}, a model will be created and attached to this document Required scopes: document:write
928928
* @param {Number} cloudPk A unique integer value identifying this cloud.
929929
* @param {Number} projectPk A unique integer value identifying this project.
930930
* @param {String} name Shown name of the file

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ import PatchedTopicTypeRequest from './model/PatchedTopicTypeRequest';
133133
import PatchedUnitRequest from './model/PatchedUnitRequest';
134134
import PatchedUserCloudUpdateRequest from './model/PatchedUserCloudUpdateRequest';
135135
import PatchedUserProjectUpdateRequest from './model/PatchedUserProjectUpdateRequest';
136+
import PatchedViewpointRequest from './model/PatchedViewpointRequest';
136137
import PatchedVisaCommentRequest from './model/PatchedVisaCommentRequest';
137138
import PatchedVisaRequest from './model/PatchedVisaRequest';
138139
import PatchedVisaValidationRequest from './model/PatchedVisaValidationRequest';
@@ -1015,6 +1016,12 @@ export {
10151016
*/
10161017
PatchedUserProjectUpdateRequest,
10171018

1019+
/**
1020+
* The PatchedViewpointRequest model constructor.
1021+
* @property {module:model/PatchedViewpointRequest}
1022+
*/
1023+
PatchedViewpointRequest,
1024+
10181025
/**
10191026
* The PatchedVisaCommentRequest model constructor.
10201027
* @property {module:model/PatchedVisaCommentRequest}

test/api/BcfApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,16 @@
658658
done();
659659
});
660660
});
661+
describe('updateViewpoint', function() {
662+
it('should call updateViewpoint successfully', function(done) {
663+
//uncomment below and update the code to test updateViewpoint
664+
//instance.updateViewpoint(function(error) {
665+
// if (error) throw error;
666+
//expect().to.be();
667+
//});
668+
done();
669+
});
670+
});
661671
});
662672

663673
}));

0 commit comments

Comments
 (0)