Skip to content

Commit

Permalink
MINOR: add logging for documents, folder and user invitations (#712)
Browse files Browse the repository at this point in the history
* first implementation with documents

* implement and test documents and folders

* aborted try to test folder permission propagation

* fix test get_path

* add project invitation logs

* improve admin

* typo

* add log view test and scope

* fix check_access test

* commit app migrations
  • Loading branch information
Bimdata-io committed Jan 2, 2024
1 parent ed5e2d5 commit d68b901
Show file tree
Hide file tree
Showing 9 changed files with 621 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 @@ -86,6 +86,7 @@ bimdata_api_client/model/layer_element_request.py
bimdata_api_client/model/layer_request.py
bimdata_api_client/model/line.py
bimdata_api_client/model/line_request.py
bimdata_api_client/model/log_entry.py
bimdata_api_client/model/marketplace_app_image.py
bimdata_api_client/model/marketplace_app_light.py
bimdata_api_client/model/marketplace_app_light_request.py
Expand Down Expand Up @@ -332,6 +333,7 @@ docs/LayerElementRequest.md
docs/LayerRequest.md
docs/Line.md
docs/LineRequest.md
docs/LogEntry.md
docs/MarketplaceAppImage.md
docs/MarketplaceAppLight.md
docs/MarketplaceAppLightRequest.md
Expand Down Expand Up @@ -582,6 +584,7 @@ test/test_layer_element_request.py
test/test_layer_request.py
test/test_line.py
test/test_line_request.py
test/test_log_entry.py
test/test_marketplace_app_image.py
test/test_marketplace_app_light.py
test/test_marketplace_app_light_request.py
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ Class | Method | HTTP request | Description
*CollaborationApi* | [**get_folders**](docs/CollaborationApi.md#get_folders) | **GET** /cloud/{cloud_pk}/project/{project_pk}/folder | Retrieve all folders
*CollaborationApi* | [**get_group**](docs/CollaborationApi.md#get_group) | **GET** /cloud/{cloud_pk}/project/{project_pk}/me/group/{id} | Retrieve a group
*CollaborationApi* | [**get_groups**](docs/CollaborationApi.md#get_groups) | **GET** /cloud/{cloud_pk}/project/{project_pk}/me/group | Retrieve all groups
*CollaborationApi* | [**get_logs**](docs/CollaborationApi.md#get_logs) | **GET** /cloud/{cloud_pk}/project/{project_pk}/logs | Retrieve all logs of the project
*CollaborationApi* | [**get_manage_group**](docs/CollaborationApi.md#get_manage_group) | **GET** /cloud/{cloud_pk}/project/{project_pk}/group/{id} | Retrieve a group
*CollaborationApi* | [**get_manage_groups**](docs/CollaborationApi.md#get_manage_groups) | **GET** /cloud/{cloud_pk}/project/{project_pk}/group | Retrieve all groups
*CollaborationApi* | [**get_project**](docs/CollaborationApi.md#get_project) | **GET** /cloud/{cloud_pk}/project/{id} | Retrieve a project
Expand Down Expand Up @@ -723,6 +724,7 @@ Class | Method | HTTP request | Description
- [LayerRequest](docs/LayerRequest.md)
- [Line](docs/Line.md)
- [LineRequest](docs/LineRequest.md)
- [LogEntry](docs/LogEntry.md)
- [MarketplaceAppImage](docs/MarketplaceAppImage.md)
- [MarketplaceAppLight](docs/MarketplaceAppLight.md)
- [MarketplaceAppLightRequest](docs/MarketplaceAppLightRequest.md)
Expand Down
145 changes: 144 additions & 1 deletion bimdata_api_client/api/collaboration_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from bimdata_api_client.model.group_folder import GroupFolder
from bimdata_api_client.model.group_request import GroupRequest
from bimdata_api_client.model.import_group_request import ImportGroupRequest
from bimdata_api_client.model.log_entry import LogEntry
from bimdata_api_client.model.patched_classification_request import PatchedClassificationRequest
from bimdata_api_client.model.patched_cloud_request import PatchedCloudRequest
from bimdata_api_client.model.patched_document_request import PatchedDocumentRequest
Expand Down Expand Up @@ -4153,6 +4154,66 @@ def __init__(self, api_client=None):
},
api_client=api_client
)
self.get_logs_endpoint = _Endpoint(
settings={
'response_type': ([LogEntry],),
'auth': [
'ApiKey',
'BIMData_Connect',
'BIMData_Connect',
'Bearer'
],
'endpoint_path': '/cloud/{cloud_pk}/project/{project_pk}/logs',
'operation_id': 'get_logs',
'http_method': 'GET',
'servers': None,
},
params_map={
'all': [
'cloud_pk',
'project_pk',
],
'required': [
'cloud_pk',
'project_pk',
],
'nullable': [
],
'enum': [
],
'validation': [
]
},
root_map={
'validations': {
},
'allowed_values': {
},
'openapi_types': {
'cloud_pk':
(int,),
'project_pk':
(int,),
},
'attribute_map': {
'cloud_pk': 'cloud_pk',
'project_pk': 'project_pk',
},
'location_map': {
'cloud_pk': 'path',
'project_pk': 'path',
},
'collection_format_map': {
}
},
headers_map={
'accept': [
'application/json'
],
'content_type': [],
},
api_client=api_client
)
self.get_manage_group_endpoint = _Endpoint(
settings={
'response_type': (Group,),
Expand Down Expand Up @@ -8678,7 +8739,7 @@ def create_document(
):
"""Create a document # noqa: E501

Create a document. If the document is one of {'DWG', 'IFC', 'GLTF', 'POINT_CLOUD', 'OBJ', 'DXF'}, 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', 'POINT_CLOUD', 'DWG', 'OBJ', 'IFC', 'DXF'}, 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 Expand Up @@ -12472,6 +12533,88 @@ def get_groups(
project_pk
return self.get_groups_endpoint.call_with_http_info(**kwargs)

def get_logs(
self,
cloud_pk,
project_pk,
**kwargs
):
"""Retrieve all logs of the project # noqa: E501

Retrieve all logs of the project Required scopes: logs:read # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

>>> thread = api.get_logs(cloud_pk, project_pk, async_req=True)
>>> result = thread.get()

Args:
cloud_pk (int):
project_pk (int):

Keyword Args:
_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:
[LogEntry]
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['cloud_pk'] = \
cloud_pk
kwargs['project_pk'] = \
project_pk
return self.get_logs_endpoint.call_with_http_info(**kwargs)

def get_manage_group(
self,
cloud_pk,
Expand Down
Loading

0 comments on commit d68b901

Please sign in to comment.