Skip to content

Commit

Permalink
PATCH: restore viewpoint patch (#706)
Browse files Browse the repository at this point in the history
* restore viewpoint patch

* use ModelViewSet
  • Loading branch information
Bimdata-io committed Nov 27, 2023
1 parent 978cbee commit c2d241f
Show file tree
Hide file tree
Showing 11 changed files with 773 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ bimdata_api_client/model/patched_topic_type_request.py
bimdata_api_client/model/patched_unit_request.py
bimdata_api_client/model/patched_user_cloud_update_request.py
bimdata_api_client/model/patched_user_project_update_request.py
bimdata_api_client/model/patched_viewpoint_request.py
bimdata_api_client/model/patched_visa_comment_request.py
bimdata_api_client/model/patched_visa_request.py
bimdata_api_client/model/patched_visa_validation_request.py
Expand Down Expand Up @@ -379,6 +380,7 @@ docs/PatchedTopicTypeRequest.md
docs/PatchedUnitRequest.md
docs/PatchedUserCloudUpdateRequest.md
docs/PatchedUserProjectUpdateRequest.md
docs/PatchedViewpointRequest.md
docs/PatchedVisaCommentRequest.md
docs/PatchedVisaRequest.md
docs/PatchedVisaValidationRequest.md
Expand Down Expand Up @@ -625,6 +627,7 @@ test/test_patched_topic_type_request.py
test/test_patched_unit_request.py
test/test_patched_user_cloud_update_request.py
test/test_patched_user_project_update_request.py
test/test_patched_viewpoint_request.py
test/test_patched_visa_comment_request.py
test/test_patched_visa_request.py
test/test_patched_visa_validation_request.py
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ from bimdata_api_client.model.patched_stage_request import PatchedStageRequest
from bimdata_api_client.model.patched_topic_request import PatchedTopicRequest
from bimdata_api_client.model.patched_topic_status_request import PatchedTopicStatusRequest
from bimdata_api_client.model.patched_topic_type_request import PatchedTopicTypeRequest
from bimdata_api_client.model.patched_viewpoint_request import PatchedViewpointRequest
from bimdata_api_client.model.pin import Pin
from bimdata_api_client.model.pin_request import PinRequest
from bimdata_api_client.model.priority import Priority
Expand Down Expand Up @@ -220,6 +221,7 @@ Class | Method | HTTP request | Description
*BcfApi* | [**update_full_topic**](docs/BcfApi.md#update_full_topic) | **PATCH** /bcf/2.1/projects/{projects_pk}/full-topic/{guid} | Update some fields of a topic
*BcfApi* | [**update_pin**](docs/BcfApi.md#update_pin) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{viewpoints_guid}/pin/{guid} | Update some fields of a Pin
*BcfApi* | [**update_topic**](docs/BcfApi.md#update_topic) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{guid} | Update some fields of a topic
*BcfApi* | [**update_viewpoint**](docs/BcfApi.md#update_viewpoint) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid} | Update some fields of a Viewpoint
*CollaborationApi* | [**accept_user_invitation**](docs/CollaborationApi.md#accept_user_invitation) | **POST** /user/invitations/{id}/accept | Accept an invitation
*CollaborationApi* | [**accept_validation**](docs/CollaborationApi.md#accept_validation) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/validation/{id}/accept | Accept a validation
*CollaborationApi* | [**add_document_tag**](docs/CollaborationApi.md#add_document_tag) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/tag | Add a tag to a document
Expand Down Expand Up @@ -760,6 +762,7 @@ Class | Method | HTTP request | Description
- [PatchedUnitRequest](docs/PatchedUnitRequest.md)
- [PatchedUserCloudUpdateRequest](docs/PatchedUserCloudUpdateRequest.md)
- [PatchedUserProjectUpdateRequest](docs/PatchedUserProjectUpdateRequest.md)
- [PatchedViewpointRequest](docs/PatchedViewpointRequest.md)
- [PatchedVisaCommentRequest](docs/PatchedVisaCommentRequest.md)
- [PatchedVisaRequest](docs/PatchedVisaRequest.md)
- [PatchedVisaValidationRequest](docs/PatchedVisaValidationRequest.md)
Expand Down
173 changes: 173 additions & 0 deletions bimdata_api_client/api/bcf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from bimdata_api_client.model.patched_topic_request import PatchedTopicRequest
from bimdata_api_client.model.patched_topic_status_request import PatchedTopicStatusRequest
from bimdata_api_client.model.patched_topic_type_request import PatchedTopicTypeRequest
from bimdata_api_client.model.patched_viewpoint_request import PatchedViewpointRequest
from bimdata_api_client.model.pin import Pin
from bimdata_api_client.model.pin_request import PinRequest
from bimdata_api_client.model.priority import Priority
Expand Down Expand Up @@ -4106,6 +4107,90 @@ def __init__(self, api_client=None):
},
api_client=api_client
)
self.update_viewpoint_endpoint = _Endpoint(
settings={
'response_type': (Viewpoint,),
'auth': [
'ApiKey',
'BIMData_Connect',
'BIMData_Connect',
'Bearer'
],
'endpoint_path': '/bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid}',
'operation_id': 'update_viewpoint',
'http_method': 'PATCH',
'servers': None,
},
params_map={
'all': [
'guid',
'projects_pk',
'topics_guid',
'img_format',
'patched_viewpoint_request',
],
'required': [
'guid',
'projects_pk',
'topics_guid',
],
'nullable': [
],
'enum': [
'img_format',
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
('img_format',): {

"URL": "url"
},
},
'openapi_types': {
'guid':
(str,),
'projects_pk':
(int,),
'topics_guid':
(str,),
'img_format':
(str,),
'patched_viewpoint_request':
(PatchedViewpointRequest,),
},
'attribute_map': {
'guid': 'guid',
'projects_pk': 'projects_pk',
'topics_guid': 'topics_guid',
'img_format': 'img_format',
},
'location_map': {
'guid': 'path',
'projects_pk': 'path',
'topics_guid': 'path',
'img_format': 'query',
'patched_viewpoint_request': 'body',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [
'application/json',
'application/x-www-form-urlencoded',
'multipart/form-data'
]
},
api_client=api_client
)

def create_comment(
self,
Expand Down Expand Up @@ -9177,3 +9262,91 @@ def update_topic(
projects_pk
return self.update_topic_endpoint.call_with_http_info(**kwargs)

def update_viewpoint(
self,
guid,
projects_pk,
topics_guid,
**kwargs
):
"""Update some fields of a Viewpoint # noqa: E501
This is not a standard route. Update some fields of a Viewpoint Required scopes: bcf:write # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.update_viewpoint(guid, projects_pk, topics_guid, async_req=True)
>>> result = thread.get()
Args:
guid (str):
projects_pk (int):
topics_guid (str):
Keyword Args:
img_format (str): All snapshot_data will be returned as url instead of base64. [optional] if omitted the server will use the default value of "url"
patched_viewpoint_request (PatchedViewpointRequest): [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (int/float/tuple): timeout setting for this request. If
one number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_content_type (str/None): force body content-type.
Default is None and content-type will be predicted by allowed
content-types and body.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
Viewpoint
If the method is called asynchronously, returns the request
thread.
"""
kwargs['async_req'] = kwargs.get(
'async_req', False
)
kwargs['_return_http_data_only'] = kwargs.get(
'_return_http_data_only', True
)
kwargs['_preload_content'] = kwargs.get(
'_preload_content', True
)
kwargs['_request_timeout'] = kwargs.get(
'_request_timeout', None
)
kwargs['_check_input_type'] = kwargs.get(
'_check_input_type', True
)
kwargs['_check_return_type'] = kwargs.get(
'_check_return_type', True
)
kwargs['_spec_property_naming'] = kwargs.get(
'_spec_property_naming', False
)
kwargs['_content_type'] = kwargs.get(
'_content_type')
kwargs['_host_index'] = kwargs.get('_host_index')
kwargs['guid'] = \
guid
kwargs['projects_pk'] = \
projects_pk
kwargs['topics_guid'] = \
topics_guid
return self.update_viewpoint_endpoint.call_with_http_info(**kwargs)

2 changes: 1 addition & 1 deletion bimdata_api_client/api/collaboration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8298,7 +8298,7 @@ def create_document(
):
"""Create a document # noqa: E501

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 # noqa: E501
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 # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down
Loading

0 comments on commit c2d241f

Please sign in to comment.