Skip to content

Commit 7e45889

Browse files
committed
MINOR: import from project route (#664)
* feat: clone project route * renaming route, reverse pk and project_id * renaming * simpler help text
1 parent ba4fb76 commit 7e45889

File tree

9 files changed

+613
-4
lines changed

9 files changed

+613
-4
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ bimdata_api_client/model/project.py
155155
bimdata_api_client/model/project_access_token.py
156156
bimdata_api_client/model/project_access_token_request.py
157157
bimdata_api_client/model/project_folder_tree.py
158+
bimdata_api_client/model/project_import_request.py
158159
bimdata_api_client/model/project_invitation.py
159160
bimdata_api_client/model/project_invitation_request.py
160161
bimdata_api_client/model/project_request.py
@@ -394,6 +395,7 @@ docs/Project.md
394395
docs/ProjectAccessToken.md
395396
docs/ProjectAccessTokenRequest.md
396397
docs/ProjectFolderTree.md
398+
docs/ProjectImportRequest.md
397399
docs/ProjectInvitation.md
398400
docs/ProjectInvitationRequest.md
399401
docs/ProjectRequest.md
@@ -636,6 +638,7 @@ test/test_project.py
636638
test/test_project_access_token.py
637639
test/test_project_access_token_request.py
638640
test/test_project_folder_tree.py
641+
test/test_project_import_request.py
639642
test/test_project_invitation.py
640643
test/test_project_invitation_request.py
641644
test/test_project_request.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ Class | Method | HTTP request | Description
305305
*CollaborationApi* | [**get_visa_comment**](docs/CollaborationApi.md#get_visa_comment) | **GET** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/comment/{id} | Retrieve a comment
306306
*CollaborationApi* | [**get_visa_comments**](docs/CollaborationApi.md#get_visa_comments) | **GET** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/comment | List all comment of a visa
307307
*CollaborationApi* | [**get_visas**](docs/CollaborationApi.md#get_visas) | **GET** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa | List all visas of a document
308+
*CollaborationApi* | [**import_from_project**](docs/CollaborationApi.md#import_from_project) | **POST** /cloud/{cloud_pk}/project/{id}/import_from | Import data from a project
308309
*CollaborationApi* | [**import_manage_group**](docs/CollaborationApi.md#import_manage_group) | **POST** /cloud/{cloud_pk}/project/{project_pk}/group/import | Import a group from another project
309310
*CollaborationApi* | [**invite_cloud_user**](docs/CollaborationApi.md#invite_cloud_user) | **POST** /cloud/{cloud_pk}/invitation | Invite a cloud administrator
310311
*CollaborationApi* | [**invite_project_user**](docs/CollaborationApi.md#invite_project_user) | **POST** /cloud/{cloud_pk}/project/{project_pk}/invitation | Invite a project member
@@ -778,6 +779,7 @@ Class | Method | HTTP request | Description
778779
- [ProjectAccessToken](docs/ProjectAccessToken.md)
779780
- [ProjectAccessTokenRequest](docs/ProjectAccessTokenRequest.md)
780781
- [ProjectFolderTree](docs/ProjectFolderTree.md)
782+
- [ProjectImportRequest](docs/ProjectImportRequest.md)
781783
- [ProjectInvitation](docs/ProjectInvitation.md)
782784
- [ProjectInvitationRequest](docs/ProjectInvitationRequest.md)
783785
- [ProjectRequest](docs/ProjectRequest.md)

bimdata_api_client/api/collaboration_api.py

Lines changed: 158 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
from bimdata_api_client.model.project_access_token import ProjectAccessToken
5858
from bimdata_api_client.model.project_access_token_request import ProjectAccessTokenRequest
5959
from bimdata_api_client.model.project_folder_tree import ProjectFolderTree
60+
from bimdata_api_client.model.project_import_request import ProjectImportRequest
6061
from bimdata_api_client.model.project_invitation import ProjectInvitation
6162
from bimdata_api_client.model.project_invitation_request import ProjectInvitationRequest
6263
from bimdata_api_client.model.project_request import ProjectRequest
@@ -5453,6 +5454,75 @@ def __init__(self, api_client=None):
54535454
},
54545455
api_client=api_client
54555456
)
5457+
self.import_from_project_endpoint = _Endpoint(
5458+
settings={
5459+
'response_type': (Project,),
5460+
'auth': [
5461+
'ApiKey',
5462+
'BIMData_Connect',
5463+
'BIMData_Connect',
5464+
'Bearer'
5465+
],
5466+
'endpoint_path': '/cloud/{cloud_pk}/project/{id}/import_from',
5467+
'operation_id': 'import_from_project',
5468+
'http_method': 'POST',
5469+
'servers': None,
5470+
},
5471+
params_map={
5472+
'all': [
5473+
'cloud_pk',
5474+
'id',
5475+
'project_import_request',
5476+
],
5477+
'required': [
5478+
'cloud_pk',
5479+
'id',
5480+
'project_import_request',
5481+
],
5482+
'nullable': [
5483+
],
5484+
'enum': [
5485+
],
5486+
'validation': [
5487+
]
5488+
},
5489+
root_map={
5490+
'validations': {
5491+
},
5492+
'allowed_values': {
5493+
},
5494+
'openapi_types': {
5495+
'cloud_pk':
5496+
(int,),
5497+
'id':
5498+
(int,),
5499+
'project_import_request':
5500+
(ProjectImportRequest,),
5501+
},
5502+
'attribute_map': {
5503+
'cloud_pk': 'cloud_pk',
5504+
'id': 'id',
5505+
},
5506+
'location_map': {
5507+
'cloud_pk': 'path',
5508+
'id': 'path',
5509+
'project_import_request': 'body',
5510+
},
5511+
'collection_format_map': {
5512+
}
5513+
},
5514+
headers_map={
5515+
'accept': [
5516+
'application/json'
5517+
],
5518+
'content_type': [
5519+
'application/json',
5520+
'application/x-www-form-urlencoded',
5521+
'multipart/form-data'
5522+
]
5523+
},
5524+
api_client=api_client
5525+
)
54565526
self.import_manage_group_endpoint = _Endpoint(
54575527
settings={
54585528
'response_type': ([Group],),
@@ -8303,7 +8373,7 @@ def create_document(
83038373
):
83048374
"""Create a document # noqa: E501
83058375

8306-
Create a document. If the document is one of {'DXF', 'OBJ', 'IFC', 'POINT_CLOUD', 'GLTF', 'DWG'}, a model will be created and attached to this document Required scopes: document:write # noqa: E501
8376+
Create a document. If the document is one of {'GLTF', 'POINT_CLOUD', 'DWG', 'OBJ', 'IFC', 'DXF'}, a model will be created and attached to this document Required scopes: document:write # noqa: E501
83078377
This method makes a synchronous HTTP request by default. To make an
83088378
asynchronous HTTP request, please pass async_req=True
83098379

@@ -14201,6 +14271,92 @@ def get_visas(
1420114271
project_pk
1420214272
return self.get_visas_endpoint.call_with_http_info(**kwargs)
1420314273

14274+
def import_from_project(
14275+
self,
14276+
cloud_pk,
14277+
id,
14278+
project_import_request,
14279+
**kwargs
14280+
):
14281+
"""Import data from a project # noqa: E501
14282+
14283+
Import dms tree and/or the groups from a project Required scopes: org:manage # noqa: E501
14284+
This method makes a synchronous HTTP request by default. To make an
14285+
asynchronous HTTP request, please pass async_req=True
14286+
14287+
>>> thread = api.import_from_project(cloud_pk, id, project_import_request, async_req=True)
14288+
>>> result = thread.get()
14289+
14290+
Args:
14291+
cloud_pk (int):
14292+
id (int): A unique integer value identifying this project.
14293+
project_import_request (ProjectImportRequest):
14294+
14295+
Keyword Args:
14296+
_return_http_data_only (bool): response data without head status
14297+
code and headers. Default is True.
14298+
_preload_content (bool): if False, the urllib3.HTTPResponse object
14299+
will be returned without reading/decoding response data.
14300+
Default is True.
14301+
_request_timeout (int/float/tuple): timeout setting for this request. If
14302+
one number provided, it will be total request timeout. It can also
14303+
be a pair (tuple) of (connection, read) timeouts.
14304+
Default is None.
14305+
_check_input_type (bool): specifies if type checking
14306+
should be done one the data sent to the server.
14307+
Default is True.
14308+
_check_return_type (bool): specifies if type checking
14309+
should be done one the data received from the server.
14310+
Default is True.
14311+
_spec_property_naming (bool): True if the variable names in the input data
14312+
are serialized names, as specified in the OpenAPI document.
14313+
False if the variable names in the input data
14314+
are pythonic names, e.g. snake case (default)
14315+
_content_type (str/None): force body content-type.
14316+
Default is None and content-type will be predicted by allowed
14317+
content-types and body.
14318+
_host_index (int/None): specifies the index of the server
14319+
that we want to use.
14320+
Default is read from the configuration.
14321+
async_req (bool): execute request asynchronously
14322+
14323+
Returns:
14324+
Project
14325+
If the method is called asynchronously, returns the request
14326+
thread.
14327+
"""
14328+
kwargs['async_req'] = kwargs.get(
14329+
'async_req', False
14330+
)
14331+
kwargs['_return_http_data_only'] = kwargs.get(
14332+
'_return_http_data_only', True
14333+
)
14334+
kwargs['_preload_content'] = kwargs.get(
14335+
'_preload_content', True
14336+
)
14337+
kwargs['_request_timeout'] = kwargs.get(
14338+
'_request_timeout', None
14339+
)
14340+
kwargs['_check_input_type'] = kwargs.get(
14341+
'_check_input_type', True
14342+
)
14343+
kwargs['_check_return_type'] = kwargs.get(
14344+
'_check_return_type', True
14345+
)
14346+
kwargs['_spec_property_naming'] = kwargs.get(
14347+
'_spec_property_naming', False
14348+
)
14349+
kwargs['_content_type'] = kwargs.get(
14350+
'_content_type')
14351+
kwargs['_host_index'] = kwargs.get('_host_index')
14352+
kwargs['cloud_pk'] = \
14353+
cloud_pk
14354+
kwargs['id'] = \
14355+
id
14356+
kwargs['project_import_request'] = \
14357+
project_import_request
14358+
return self.import_from_project_endpoint.call_with_http_info(**kwargs)
14359+
1420414360
def import_manage_group(
1420514361
self,
1420614362
cloud_pk,
@@ -14210,7 +14366,7 @@ def import_manage_group(
1421014366
):
1421114367
"""Import a group from another project # noqa: E501
1421214368

14213-
Import a group from another project. Must be an admin of the project Required scopes: org:manage # noqa: E501
14369+
DEPECRATED: Use ImportFromProject instead Required scopes: org:manage # noqa: E501
1421414370
This method makes a synchronous HTTP request by default. To make an
1421514371
asynchronous HTTP request, please pass async_req=True
1421614372

0 commit comments

Comments
 (0)