Skip to content

Commit

Permalink
MINOR: add user deail to check-access response (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bimdata-io committed Nov 29, 2023
1 parent adc39fc commit 368656e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
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 {'GLTF', 'DWG', 'DXF', 'POINT_CLOUD', 'IFC', 'OBJ'}, 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 {'IFC', 'DXF', 'GLTF', 'OBJ', 'DWG', 'POINT_CLOUD'}, 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
10 changes: 10 additions & 0 deletions bimdata_api_client/model/check_project_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
from bimdata_api_client.exceptions import ApiAttributeError


def lazy_import():
from bimdata_api_client.model.user import User
globals()['User'] = User


class CheckProjectAccess(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Expand Down Expand Up @@ -72,6 +76,7 @@ def additional_properties_type():
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501

_nullable = False
Expand All @@ -86,13 +91,15 @@ def openapi_types():
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
'has_read_permission': (bool,), # noqa: E501
'has_write_permission': (bool,), # noqa: E501
'has_admin_permission': (bool,), # noqa: E501
'token_scopes': ([str],), # noqa: E501
'usable_scopes': ([str],), # noqa: E501
'user_role': (int,), # noqa: E501
'user': (User,), # noqa: E501
}

@cached_property
Expand All @@ -107,6 +114,7 @@ def discriminator():
'token_scopes': 'token_scopes', # noqa: E501
'usable_scopes': 'usable_scopes', # noqa: E501
'user_role': 'user_role', # noqa: E501
'user': 'user', # noqa: E501
}

read_only_vars = {
Expand Down Expand Up @@ -158,6 +166,7 @@ def _from_openapi_data(cls, has_read_permission, has_write_permission, has_admin
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
user_role (int): * `100` - admin * `50` - user * `25` - guest. [optional] # noqa: E501
user (User): [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down Expand Up @@ -252,6 +261,7 @@ def __init__(self, has_read_permission, has_write_permission, has_admin_permissi
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
user_role (int): * `100` - admin * `50` - user * `25` - guest. [optional] # noqa: E501
user (User): [optional] # noqa: E501
"""

_check_type = kwargs.pop('_check_type', True)
Expand Down
1 change: 1 addition & 0 deletions docs/CheckProjectAccess.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**token_scopes** | **[str]** | |
**usable_scopes** | **[str]** | Some tokens may have write scopes (eg: model:write) but the user of the token is a guest in the project so they can't use the scopes. |
**user_role** | **int** | * `100` - admin * `50` - user * `25` - guest | [optional]
**user** | [**User**](User.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/CollaborationApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1526,7 +1526,7 @@ Name | Type | Description | Notes

Create a document

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
Create a document. If the document is one of {'IFC', 'DXF', 'GLTF', 'OBJ', 'DWG', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write

### Example

Expand Down
2 changes: 2 additions & 0 deletions test/test_check_project_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import unittest

import bimdata_api_client
from bimdata_api_client.model.user import User
globals()['User'] = User
from bimdata_api_client.model.check_project_access import CheckProjectAccess


Expand Down

0 comments on commit 368656e

Please sign in to comment.