Skip to content

Commit bfb2c05

Browse files
committed
MINOR: add project check access route(#561)
* Add projcte check-access route * add route description * update tests with new invitation routes
1 parent 6d49128 commit bfb2c05

File tree

9 files changed

+612
-2
lines changed

9 files changed

+612
-2
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ bimdata_api_client/model/building.py
2222
bimdata_api_client/model/building_model_plan_request.py
2323
bimdata_api_client/model/check_plan.py
2424
bimdata_api_client/model/check_plan_request.py
25+
bimdata_api_client/model/check_project_access.py
2526
bimdata_api_client/model/checker_result.py
2627
bimdata_api_client/model/checker_result_request.py
2728
bimdata_api_client/model/classification.py
@@ -269,6 +270,7 @@ docs/Building.md
269270
docs/BuildingModelPlanRequest.md
270271
docs/CheckPlan.md
271272
docs/CheckPlanRequest.md
273+
docs/CheckProjectAccess.md
272274
docs/CheckerApi.md
273275
docs/CheckerResult.md
274276
docs/CheckerResultRequest.md
@@ -523,6 +525,7 @@ test/test_building.py
523525
test/test_building_model_plan_request.py
524526
test/test_check_plan.py
525527
test/test_check_plan_request.py
528+
test/test_check_project_access.py
526529
test/test_checker_api.py
527530
test/test_checker_result.py
528531
test/test_checker_result_request.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ Class | Method | HTTP request | Description
245245
*CollaborationApi* | [**cancel_cloud_user_invitation**](docs/CollaborationApi.md#cancel_cloud_user_invitation) | **DELETE** /cloud/{cloud_pk}/invitation/{id} | Cancel a pending invitation
246246
*CollaborationApi* | [**cancel_project_user_invitation**](docs/CollaborationApi.md#cancel_project_user_invitation) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/invitation/{id} | Cancel a pending invitation
247247
*CollaborationApi* | [**check_access**](docs/CollaborationApi.md#check_access) | **GET** /cloud/{id}/check-access | Check app access from cloud
248+
*CollaborationApi* | [**check_project_access**](docs/CollaborationApi.md#check_project_access) | **GET** /cloud/{cloud_pk}/project/{id}/check-access | Check if the current token has access to the requested project
248249
*CollaborationApi* | [**close_visa**](docs/CollaborationApi.md#close_visa) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{id}/close | Close a visa of a document
249250
*CollaborationApi* | [**create_classification**](docs/CollaborationApi.md#create_classification) | **POST** /cloud/{cloud_pk}/project/{project_pk}/classification | Create a classification
250251
*CollaborationApi* | [**create_cloud**](docs/CollaborationApi.md#create_cloud) | **POST** /cloud | Create a cloud
@@ -664,6 +665,7 @@ Class | Method | HTTP request | Description
664665
- [BuildingModelPlanRequest](docs/BuildingModelPlanRequest.md)
665666
- [CheckPlan](docs/CheckPlan.md)
666667
- [CheckPlanRequest](docs/CheckPlanRequest.md)
668+
- [CheckProjectAccess](docs/CheckProjectAccess.md)
667669
- [CheckerResult](docs/CheckerResult.md)
668670
- [CheckerResultRequest](docs/CheckerResultRequest.md)
669671
- [Classification](docs/Classification.md)

bimdata_api_client/api/collaboration_api.py

Lines changed: 144 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
none_type,
2323
validate_and_convert_types
2424
)
25+
from bimdata_api_client.model.check_project_access import CheckProjectAccess
2526
from bimdata_api_client.model.classification import Classification
2627
from bimdata_api_client.model.classification_request import ClassificationRequest
2728
from bimdata_api_client.model.cloud import Cloud
@@ -540,6 +541,66 @@ def __init__(self, api_client=None):
540541
},
541542
api_client=api_client
542543
)
544+
self.check_project_access_endpoint = _Endpoint(
545+
settings={
546+
'response_type': (CheckProjectAccess,),
547+
'auth': [
548+
'ApiKey',
549+
'BIMData_Connect',
550+
'BIMData_Connect',
551+
'Bearer'
552+
],
553+
'endpoint_path': '/cloud/{cloud_pk}/project/{id}/check-access',
554+
'operation_id': 'check_project_access',
555+
'http_method': 'GET',
556+
'servers': None,
557+
},
558+
params_map={
559+
'all': [
560+
'cloud_pk',
561+
'id',
562+
],
563+
'required': [
564+
'cloud_pk',
565+
'id',
566+
],
567+
'nullable': [
568+
],
569+
'enum': [
570+
],
571+
'validation': [
572+
]
573+
},
574+
root_map={
575+
'validations': {
576+
},
577+
'allowed_values': {
578+
},
579+
'openapi_types': {
580+
'cloud_pk':
581+
(int,),
582+
'id':
583+
(int,),
584+
},
585+
'attribute_map': {
586+
'cloud_pk': 'cloud_pk',
587+
'id': 'id',
588+
},
589+
'location_map': {
590+
'cloud_pk': 'path',
591+
'id': 'path',
592+
},
593+
'collection_format_map': {
594+
}
595+
},
596+
headers_map={
597+
'accept': [
598+
'application/json'
599+
],
600+
'content_type': [],
601+
},
602+
api_client=api_client
603+
)
543604
self.close_visa_endpoint = _Endpoint(
544605
settings={
545606
'response_type': None,
@@ -7599,6 +7660,88 @@ def check_access(
75997660
id
76007661
return self.check_access_endpoint.call_with_http_info(**kwargs)
76017662

7663+
def check_project_access(
7664+
self,
7665+
cloud_pk,
7666+
id,
7667+
**kwargs
7668+
):
7669+
"""Check if the current token has access to the requested project # noqa: E501
7670+
7671+
The response gives you details about the right of the user or app, the scopes of the token and the usable scopes (scopes filtered by the right of the user). It works with user tokens, app tokens and ProjectAccessToken # noqa: E501
7672+
This method makes a synchronous HTTP request by default. To make an
7673+
asynchronous HTTP request, please pass async_req=True
7674+
7675+
>>> thread = api.check_project_access(cloud_pk, id, async_req=True)
7676+
>>> result = thread.get()
7677+
7678+
Args:
7679+
cloud_pk (int):
7680+
id (int): A unique integer value identifying this project.
7681+
7682+
Keyword Args:
7683+
_return_http_data_only (bool): response data without head status
7684+
code and headers. Default is True.
7685+
_preload_content (bool): if False, the urllib3.HTTPResponse object
7686+
will be returned without reading/decoding response data.
7687+
Default is True.
7688+
_request_timeout (int/float/tuple): timeout setting for this request. If
7689+
one number provided, it will be total request timeout. It can also
7690+
be a pair (tuple) of (connection, read) timeouts.
7691+
Default is None.
7692+
_check_input_type (bool): specifies if type checking
7693+
should be done one the data sent to the server.
7694+
Default is True.
7695+
_check_return_type (bool): specifies if type checking
7696+
should be done one the data received from the server.
7697+
Default is True.
7698+
_spec_property_naming (bool): True if the variable names in the input data
7699+
are serialized names, as specified in the OpenAPI document.
7700+
False if the variable names in the input data
7701+
are pythonic names, e.g. snake case (default)
7702+
_content_type (str/None): force body content-type.
7703+
Default is None and content-type will be predicted by allowed
7704+
content-types and body.
7705+
_host_index (int/None): specifies the index of the server
7706+
that we want to use.
7707+
Default is read from the configuration.
7708+
async_req (bool): execute request asynchronously
7709+
7710+
Returns:
7711+
CheckProjectAccess
7712+
If the method is called asynchronously, returns the request
7713+
thread.
7714+
"""
7715+
kwargs['async_req'] = kwargs.get(
7716+
'async_req', False
7717+
)
7718+
kwargs['_return_http_data_only'] = kwargs.get(
7719+
'_return_http_data_only', True
7720+
)
7721+
kwargs['_preload_content'] = kwargs.get(
7722+
'_preload_content', True
7723+
)
7724+
kwargs['_request_timeout'] = kwargs.get(
7725+
'_request_timeout', None
7726+
)
7727+
kwargs['_check_input_type'] = kwargs.get(
7728+
'_check_input_type', True
7729+
)
7730+
kwargs['_check_return_type'] = kwargs.get(
7731+
'_check_return_type', True
7732+
)
7733+
kwargs['_spec_property_naming'] = kwargs.get(
7734+
'_spec_property_naming', False
7735+
)
7736+
kwargs['_content_type'] = kwargs.get(
7737+
'_content_type')
7738+
kwargs['_host_index'] = kwargs.get('_host_index')
7739+
kwargs['cloud_pk'] = \
7740+
cloud_pk
7741+
kwargs['id'] = \
7742+
id
7743+
return self.check_project_access_endpoint.call_with_http_info(**kwargs)
7744+
76027745
def close_visa(
76037746
self,
76047747
cloud_pk,
@@ -8027,7 +8170,7 @@ def create_document(
80278170
):
80288171
"""Create a document # noqa: E501
80298172

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

0 commit comments

Comments
 (0)